杀死数据库连接
use MASTER
declare @spid int
declare CUR cursor for
select spid
from sysprocesses
where dbid = (select dbid
from sysdatabases
where name = 'ycmis')
open cur
fetch next from CUR into @spid
while @@FETCH_STATUS = 0
begin
exec ('KILL ' + @spid )
fetch next from CUR into @spid
end
close CUR
deallocate CUR
---------------------------------------------------------------------------------
select sysdatabases.* ,
sysdatabases.name
from sysprocesses
join sysdatabases on sysprocesses.dbid = sysdatabases.dbid
and name = 'ycmis'
declare @spid int
declare CUR cursor for
select spid
from sysprocesses
where dbid = (select dbid
from sysdatabases
where name = 'ycmis')
open cur
fetch next from CUR into @spid
while @@FETCH_STATUS = 0
begin
exec ('KILL ' + @spid )
fetch next from CUR into @spid
end
close CUR
deallocate CUR
---------------------------------------------------------------------------------
select sysdatabases.* ,
sysdatabases.name
from sysprocesses
join sysdatabases on sysprocesses.dbid = sysdatabases.dbid
and name = 'ycmis'