Thursday, 11 June 2009

How to check Entire Instance SQL Server Database, Logical and Physical Name

Below is the script to find Database, Logical and Physical Name

a) select db_name(database_id) as DBNAME,name AS LOGICALFILENAME,physical_name AS [PHYSICAL_NAME] from sys.master_files(NOLOCK) -- To find all Database Name, Logical and Physical Name

b) select db_name(database_id) as DBNAME,name AS LOGICALFILENAME,physical_name AS [PHYSICAL_NAME] from sys.master_files(NOLOCK) WHERE TYPE_DESC='LOG' -- -- To find all Database Name, Logical Log File

c) select db_name(database_id) as DBNAME,name AS LOGICALFILENAME,physical_name AS [PHYSICAL_NAME] from sys.master_files(NOLOCK) WHERE TYPE_DESC='ROWS' ---- To find all Database Name, Logical Data File


No comments:

Post a Comment