Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions Links


SQL Server DBA Jobs

How to check SQL Server Filegroup file sizes

02 November,2020 by Tom Collins

I had a question from a fellow DBA about how to list every file  per SQL Server filegroup , and report on the size in MB. This will give them a quick way of checking which file could be creating a capacity issue. 

Quite often , alerting is set up to check the whole drive , but won't check every file. So some granular report can identify the file causing a capacity issue 

--Return file , size in MB , filegroup 

SELECT AS [File_Name],
sdf.size/128 AS [Size_MB], AS [FileGroup_Name],
sdf.physical_name as [File_physical_name]
FROM sys.database_files sdf
sys.filegroups fg
ON sdf.data_space_id=fg.data_space_id

Read more on Filegroups

How to create a table in another FILEGROUP using SELECT INTO ...

Moving a Non Clustered Index to another filegroup ...


Author: Tom Collins (


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on How to check SQL Server Filegroup file sizes | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer