views:

32

answers:

0

I'm using VS2010 Schema Compare to compare two databases - let's call them 'PerfectDB' and 'DodgyDB'. I want DodgyDB to have its schema altered to match PerfectDB.

I select PerfectDB as the source and DodgyDB 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 Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\PerfectDB.mdf' cannot be overwritten. It is being used by database 'PerfectDB'.

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?

Thanks in advance.