Listing information about all database files in SQL Server

后端 未结 13 2110
遥遥无期
遥遥无期 2021-02-01 00:08

Is it possible to list information about the files (MDF/LDF) of all databases on an SQL Server?

I\'d like to get a list showing which database is using what files on th

13条回答
  •  盖世英雄少女心
    2021-02-01 00:37

    Using this script you can show all the databases name and files used (with exception of system dbs).

    select name,physical_name from sys.master_files where database_id > 4
    

提交回复
热议问题