Home Dashboard Directory Help
Search

Restore Database option of Overwrite the existing database status is ignored by gumpy_


Status: 

Closed
 as Not Reproducible Help for as Not Reproducible


2
0
Sign in
to vote
Type: Bug
ID: 285885
Opened: 7/2/2007 9:23:58 PM
Access Restriction: Public
0
Workaround(s)
view
2
User(s) can reproduce this bug

Description

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.
Details
Sign in to post a comment.
Posted by JediSQL 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.

Posted by Adri on 11/24/2009 at 2:18 AM
Hi,

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.

Adri
Posted by Microsoft on 2/13/2008 at 3:18 PM
Hi,

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.

Regards
Vinod
Posted by Microsoft on 10/31/2007 at 11:58 AM
Hello Gumpy,

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.

Thanks again
-Karthik
SQL Server Team
Sign in to post a workaround.