When restoring a backup, how do I disconnect all active connections?

后端 未结 10 1033
失恋的感觉
失恋的感觉 2020-12-22 15:26

My SQL Server 2005 doesn\'t restore a backup because of active connections. How can I force it?

10条回答
  •  轮回少年
    2020-12-22 15:51

    SQL Server Management Studio 2005

    When you right click on a database and click Tasks and then click Detach Database, it brings up a dialog with the active connections.

    By clicking on the hyperlink under "Messages" you can kill the active connections.

    You can then kill those connections without detaching the database.

    More information here.

    SQL Server Management Studio 2008

    The interface has changed for SQL Server Management studio 2008, here are the steps (via: Tim Leung)

    1. Right-click the server in Object Explorer and select 'Activity Monitor'.
    2. When this opens, expand the Processes group.
    3. Now use the drop-down to filter the results by database name.
    4. Kill off the server connections by selecting the right-click 'Kill Process' option.

提交回复
热议问题