Skip to content

Instantly share code, notes, and snippets.

@amtwo
Created January 17, 2018 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amtwo/855698b1b51634d02f8de498586642b3 to your computer and use it in GitHub Desktop.
Save amtwo/855698b1b51634d02f8de498586642b3 to your computer and use it in GitHub Desktop.
--Parse backup files
SELECT fp.*
FROM msdb.dbo.backupmediafamily bmf
CROSS APPLY DBA.dbo.ParseFilePath(bmf.physical_device_name) fp;
--Parse database data files
SELECT fp.*
FROM sys.master_files mf
CROSS APPLY DBA.dbo.ParseFilePath(mf.physical_name) fp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment