![]() |
語法如下:
use master
declare @spid int
declare getspid cursor for select spid from sysprocesses where dbid=db_id('資料庫名稱')
open getspid
fetch next from getspid into @spid
while @@FETCH_STATUS<>-1
begin
exec('kill '+@spid)
fetch next from getspid into @spid
end
close getspid
deallocate getspid
這樣有連結到該資料庫的所有spid皆一併刪除。
沒有留言:
張貼留言