标签:test 技术 roc class sqlserver src RoCE dbi lse
数据库名:test1
1. 查询数据库当前连接
select * from master.sys.sysprocesses where dbid = db_id(‘test1‘)
2. 断开指定连接
语法:kill spid号
如:
kill 58
3. 断开所有连接
declare @d varchar(8000) set @d= ‘ ‘ select @d=@d+ ‘ kill ‘+cast(spid as varchar)+char(13) from master.sys.sysprocesses where dbid=db_id(‘test1‘) exec(@d)
标签:test 技术 roc class sqlserver src RoCE dbi lse
原文地址:https://www.cnblogs.com/Martianhh/p/10000420.html