原文:https://blog.csdn.net/duanbeibei/article/details/51768078
declare @d varchar(8000)
set @d= ' '
select @d=@d+ ' kill '+cast(spid as varchar)+char(13)
from master.sys.sysprocesses where dbid=db_id('testdb2')
exec(@d)
————————————————
版权声明:本文为CSDN博主「duanbeibei」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/duanbeibei/article/details/51768078