views:

11

answers:

1

Let's say I want to (using Visual Studio) run a schema comparison between two databases, restore one of them from a backup, and run the schema comparison again. The schema comparison maintains a connection to the database, and SQL Server won't let me run the restore without removing all connections. Is there a way I can force the schema comparison to disconnect without closing it?

A: 

You could:

  • Close all activities on the database (MSSMS right click on server > Activity monitor > close processes)
  • Delete the database (check close all connections) then restore the database
  • Change the connection to other database
  • Save the schema compare > close it > restore > open schema compare
rdkleine
Changing the connection is probably the best way to go about it, and probably the only one I hadn't considered. I'll see if I can adapt it into my workflow.
Chris