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' 

相关文章:

  • 2022-12-23
  • 2021-09-30
  • 2022-01-23
  • 2021-08-03
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
相关资源
相似解决方案