标签:use 查看 alter 数据库 alt rom rollback data media
USE master
GO
ALTER DATABASE [DBName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
--查看是否还有用户连接
SELECT * FROM sys.[sysprocesses] WHERE DB_NAME([dbid])=‘DBName‘
GO
ALTER DATABASE [DBName] SET MULTI_USER
GO
SQL Server 断开某个数据库所有连接(还原的时候需要)
标签:use 查看 alter 数据库 alt rom rollback data media
原文地址:http://www.cnblogs.com/hasaki/p/6370441.html