断开Sql Server 2005所有连接
代码
use master
go
declare @d varchar(8000)
set @d= ' '
select @d=@d+ ' kill '+cast(spid as varchar)+char(13)
from master..sysprocesses where dbid=db_id( 'aspectdemo ')
exec(@d)
go
declare @d varchar(8000)
set @d= ' '
select @d=@d+ ' kill '+cast(spid as varchar)+char(13)
from master..sysprocesses where dbid=db_id( 'aspectdemo ')
exec(@d)