Skip to content

Instantly share code, notes, and snippets.

@theuntitled
Created July 7, 2016 11:15
Show Gist options
  • Select an option

  • Save theuntitled/214b88058673c9f80c5a14ca784f66e7 to your computer and use it in GitHub Desktop.

Select an option

Save theuntitled/214b88058673c9f80c5a14ca784f66e7 to your computer and use it in GitHub Desktop.
Get all logical database file names
SELECT DB_NAME(database_id) AS DatabaseName, name AS LogicalFileName, physical_name AS PhysicalFileName
FROM sys.master_files AS mf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment