I’m using VS2010 Schema Compare to compare two databases – let’s call them ‘DB1’ and ‘DB2’. I want DB1 to have its schema altered to match DB2.
I select DB2 as the source and DB1 as the target, and compare.
When I hit the Write Updates button, I am getting the following error:
SQL01268: .Net SqlClient Data Provider: Msg 1834, Level 16, State 1, Line 1 The file ‘c:Program FilesMicrosoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\DB1.mdf’ cannot be overwritten. It is being used by database ‘DB1’.
Why is Schema Compare trying to create a new DB? And, more to the point, why is it trying to create a DB named the same as the Source?
Can anyone give me a workarround here?
Thanks in advance.
View Complete Post