Skip to content

Instantly share code, notes, and snippets.

@gsitgithub
Forked from justingarrick/remotedata.sql
Last active August 29, 2015 14:24
Show Gist options
  • Save gsitgithub/55991efd0d0cb0c5ad52 to your computer and use it in GitHub Desktop.
Save gsitgithub/55991efd0d0cb0c5ad52 to your computer and use it in GitHub Desktop.
SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1)
FROM master.sys.master_files
WHERE database_id = 1 AND file_id = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment