Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQL Server – sys.master_files and list all database files

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

Comments

Leave a comment on the original post [www.sqlserver-dba.com, opens in a new window]

Loading comments...