4

I am doing the below :

RESTORE DATABASE UAT
FROM DISK = 'E:\Databases\backup\MY_LIVE_20120720_070001.bak'
WITH REPLACE

But I want to be able to use a file location that ignores the numbers in the file name (which represent the date) in my back up file. There will only ever be one 'MY_LIVE_****.bak' but its number string will change each day.

The goal is to restore my UAT instance from live each week, using the latest backup - of which there will be only file matching that string prefix, but the numbers/date will change each week.

5

Not quite the answer that you're looking for, but the name of the backup file can be found in a combination the backup* tables in msdb. Your restore process could query the production msdb, figure out the backup file name, and go from there. Aside from that, there's always powershell which gives you the perfect blend of file system and database access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.