Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Database Restore with TLOGS

Author  Topic 

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2006-07-24 : 09:17:59
Quick question, I am trying to restore a database using a script, and applying TLOGS, I can get it to work when I want the database name to be its original name, but I want to restore the database to the same system using a different name, I dont know how to modify the filename that will be restored. Essentially right now I can't restore the database because it keeps wanting to restore it using the original name, and I cant do that since there is the database thats still live, I want to perform the restore to a different name, and different file names.

Kristen
Test

22859 Posts

Posted - 2006-07-24 : 09:25:42
You need the WITH MOVE command, see:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example

Kristen
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2006-07-24 : 09:31:16
appreciate the help, thanks for the quick reply Kristen
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2006-07-24 : 10:08:43
I keep getting incorrect syntax near move:

restore database IMCMFTPTEST from disk = 'e:\restore\IMCMFTP_db_200607190700.BAK' WITH NORECOVERY,STATS = 10
MOVE 'IMCMFTP_Data' TO 'e:\restore\sqldata\IMCMFTPTEST_Data.mdf',
MOVE 'IMCMFTP_Log' TO 'e:\restore\sqldata\IMCMFTPTEST_LOG.ldf'
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-07-24 : 10:35:46
Comma missing on the end of the line

STATS = 10,

Kristen
Go to Top of Page
   

- Advertisement -