SQL Server – sys.master_files and list all database files

07 March,2012 by Jack Vamvas

Use the system view “sys.master_files”  for a single view of databases and database files.

Instead of using sys.sysfiles  joing to sys.sysdatabases use the sys.master_files

 

select DB_NAME(database_id),mf.name as [file_name],physical_name
 FROM sys.master_files as mf

 

See Also

SQL Database Status with sys.databases

SQL Server Database Status,monitoring and Restores


Author: Jack Vamvas (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

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

Working...
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.

Working...

Post a comment on SQL Server – sys.master_files and list all database files


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer