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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

restore

Status
Not open for further replies.

swoodring

Programmer
Dec 7, 2000
114
US
I would like to test are backups. I would like to restore our production db call in pbdss to another database say testrestore. I looked at the restore command but don't see anywhere that I could tell it to restore it to anther db. If I can do I have to first just do a create db or will it create the db if it doesn't already exist.

I would appreciate any help on syntax and any paramaters that you would recommend using. Thanks in advance.

Stacy
 
You can restore to a new database that either exists
or does not exist. the syntax would be as follows:

RESTORE DATABASE [NewDatabaseName] FROM DISK = N'E:\Backups\XXX\YYYYY.BAK' WITH FILE = 1, NOUNLOAD , STATS = 10, RECOVERY,
MOVE 'Data_Data' To 'E:\Data\Data_Data.MDF',
MOVE 'Log_Log' To 'D:\Logs\Data_Log.LDF'

You will need to change the data and log entries to your own valid paths. This should create a new database called [newdatabaseName]. If you want to overright an existing database you will have to specify the option REPLACE.

Hope this helps,


Chris Dukes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top