Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restore .bak files saved with date/time stamps 1

Status
Not open for further replies.

JSHoltsIT

IS-IT--Management
Apr 12, 2007
66
US
On my production SQL2005 server, I run a nightly maintenance job that writes all of my user databases to .bak files to be picked up on the nightly tape backup.

I have a second SQL2005 server that I want to restore my daily .bak files to for reporting and development.

How do I either
1. have my maintenance plan write backup files to a common name (database name without the date/time stamp

2. read in the dynamically named .bak files into my restore script on the reporting/development SQL 2005 box

The .bak files in production are backed up to a tape drive, then the tape drive restores to the secondary environment (also serves to audit our tape backups prior to sending off site).

Thanks

Jason
 
After you restore the files to disk use the procedure xp_dirtree to get the list of files in the folder to be restored. I talk about usage of the procedure here
Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top