--Kick all users off of the database NOW
ALTER DATABASE YourDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE
--Kick all but after 60 seconds
ALTER DATABASE YourDatabase SET SINGLE_USER WITH ROLLBACK AFTER 60 SECONDS
--restore connection to users
ALTER DATABASE YourDatabase SET MULTI_USER
您是否尝试在分离时检查“Drop Connections”框?
不要忘记在“分离数据库”窗口中勾选“删除连接”,否则很简单,只需从菜单中选择分离即可,见下图:
此命令应删除所有连接,然后允许您分离。
ALTER DATABASE SET SINGLE_USER WITH ROLLBACK_IMMEDIATE