January 19, 2012 at 7:37 am
I'm attempting to restore a Database with the following syntax:
RESTORE DATABASE ControlDB
FROM DISK = 'I:CTLDB_backup_201201190927.bak'
WITH MOVE 'ControlDB' TO 'D:\SQLServer\Data\ControlDB.mdf',
MOVE 'ControlDB_log' TO 'D:\SQLServer\Log\ControlDB.ldf'
Msg 3154, Level 16, State 4, Line 1
The backup set holds a backup of a database other than the existing 'ControlDB' database.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I believe that I need WITH REPLACE but I forgot the syntax.
Any help would be greatly appreciated.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 19, 2012 at 7:45 am
RESTORE DATABASE ControlDB FROM DISK = 'I:\CTLDB_backup_201201190927.bak' WITH
MOVE 'ControlDB' TO 'D:\SQLServer\Data\ControlDB.mdf',
MOVE 'ControlDB_log' TO 'D:\SQLServer\Log\ControlDB.ldf', REPLACE
January 19, 2012 at 7:48 am
Thanks @richard.
I was going to edit my post because I had figured it out.:-)
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply