摘要:
ref:http://blog.csdn.net/wsh236/article/details/4296875use mastergodeclare @dbname sysnameset @dbname='DB1' --这个是要删除的数据库库名declare @s nvarchar(1000)declare tb cursor local forselect s='kill '+cast(spid as varchar)from master..sysprocesseswhere dbid=db_id(@dbname)open tbfetch next from 阅读全文