Search

SQL Server 2012 SSMS Silently Overwrites DB Name and Can Cause Accidental Overwrites and Data Loss by Greg Low - Australia

Active

16
0
Sign in
to vote
Type: Bug
ID: 779190
Opened: 2/13/2013 10:04:26 PM
Access Restriction: Public
0
Workaround(s)
1
User(s) can reproduce this bug
I've now seen this scenario at a number of client sites and it's already caused quite a bit of data loss.
It is a common operation for users to want to create a copy of their production databases for test or UAT purposes. In SQL Server 2008 R2, in the Restore Database dialog, they entered the DB name, then entered the location of the file.
In SQL Server 2012, if they enter a target DB name in the dialog, then select the file location, SSMS then silently changes the DB name they have entered with the name of the DB that was backed up. If the customer doesn't notice this silent change (as is often the case), they end up overwriting their original database with an older backup.
Details (expand)

Product Language

English

Version

SQL Server 2012 SP1

Category

Tools (SSMS, Agent, Profiler, Migration, etc.)

Operating System

Not Applicable

Operating System Language

Not Applicable

Steps to Reproduce

In SSMS, choose to restore a DB, enter a target DB name, select a file to restore.

Actual Results

The target DB name that you have entered has now been silently overwritten.

Expected Results

Once a user has entered a target DB name, it should never be silently overwritten. Doing so can easily lead to data loss.

Platform

X64

Virtualization

 
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 2/21/2013 at 10:34 AM
Thank you for reporting this issue - we are investigating and will update you when we have more information.

Thanks,

Alex Grach [MSFT SQL SERVER]
Posted by Mr. Wharty on 2/13/2013 at 10:17 PM
It should also be noted that even if you do notice the change and set the Destination Database name correctly, you still need to manually change the “Restore As” file names. In R2 these names used to default to the file names of the database you were restoring too. In 2012 these names default to the files names for the database being restored

i.e. if you were restoring database YourData (with filenames of YourData.dmf and YourData.ldf) over a database called MyData (with filenames of MyData.mdf and MyData.ldf), R2 used to default the “Restore As” file names to MyData.mdf and MyData.ldf however 2012 defaults these names to YourData.dmf and YourData.ldf.
Sign in to post a workaround.