How to force a SQL Server 2008 database to go Offline

前端 未结 2 2040
日久生厌
日久生厌 2020-12-22 17:09

How do I force my Database to go Offline, without regard to what or who is already using it?

I tried:

ALTER DATABASE database-name SET OFFLINE;
         


        
2条回答
  •  醉梦人生
    2020-12-22 17:30

    You need to use WITH ROLLBACK IMMEDIATE to boot other conections out with no regards to what or who is is already using it.

    Or use WITH NO_WAIT to not hang and not kill existing connections. See http://www.blackwasp.co.uk/SQLOffline.aspx for details

提交回复
热议问题