Get Move Names
Handy when I am scripting a restore from Prod to a testing lab.
SELECT
CONCAT('move','''',space(1),name,'''',space(1),'TO','''',SPACE(1),Physical_name,'''',',')
FROM sys.master_files
WHERE db_name(database_id) = 'TLC_CDC'
SELECT
CONCAT('move','''',space(1),name,'''',space(1),'TO','''',SPACE(1),Physical_name,'''',',')
FROM sys.master_files
WHERE db_name(database_id) = 'TLC_CDC'
0 Comments:
Post a Comment
<< Home