SQL Server Home
Restore Database option of Overwrite the existing database status is ignored
as Not Reproducible
7/2/2007 9:23:58 PM
User(s) can reproduce this bug
When restoring a database using Microsoft SQL Server Management Studio, the option to Overwrite the existing database is ignored if left as unchecked. This means that the database is overwritten without any warning or prompt, which can prove to be very bad in a live environment.
SQL Server 2005 SP2 - Standard Edition
Operating System Language
Steps to Reproduce
Right Click on Databases tree, select Restore Database...
select To Database and source, click ok.
To Database is overwritten without warning.
Warning should be shown and restore operation halted.
to post a comment.
Please enter a comment.
on 6/19/2012 at 10:53 AM
I am having this trouble in multiple instances of SQL Server 2008 R2 using T-SQL scripts. In simple recovery model, databases are just overwritten. In full recovery model, it tries to overwrite, but is blocked by this error:
Msg 3159, Level 16, State 1, Line 1
The tail of the log for the database "BackupTestDEJ" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Whether simple or full, if there is an exising database, and the WITH REPLACE option is not set, it should just stop with an error that says something like "Cannot restore over existing database without the WITH REPLACE option. It should not be going ahead and trying and, luckily in the full recovery model, getting blocked by a technical dificulty. Good thing all my production databases are in full mode.
on 11/24/2009 at 2:18 AM
IMHO it isn't still fixed at all on SQL2005 SP3 (9.0.4053)
I did a restore of database DB1, made on server S1 to an existing database DB2 on testserver S2 WITHOUT the REPLACE and expected an error about overwriting an existing database. However, the RESTORE did overwrite the existing database without any error.
on 2/13/2008 at 3:18 PM
This is issue doesnt repro now. It is fixed.By default "Overwrite the existing database" option is unchecked and we donot generate the "REPLACE" T-SQL option in the RESTORE query.
on 10/31/2007 at 11:58 AM
Thank you for reporting the problem to us. We understand the danger involved in accidently overwriting existing database. We will try to address this problem in the coming releases of SQL Server.
SQL Server Team
to post a workaround.
Please enter a workaround.
© 2014 Microsoft