日期:2014-05-17 浏览次数:20455 次
USE [master]
GO
/****** Object: StoredProcedure [dbo].[p_killspid] Script Date: 12/05/2012 11:42:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[p_killspid]
@dbname varchar(200)
as
declare @programName nvarchar(200),
@spid nvarchar(20)
declare cDblogin cursor for
select cast(spid as varchar(20)) AS spid from master..sysprocesses where dbid=db_id(@dbname)
open cDblogin
fetch next from cDblogin into @spid
while @@fetch_status=0
begin
IF @spid <> @@SPID
exec( 'kill '+@spid)
fetch next from cDblogin into @spid
end
close cDblogin
deallocate cDblogin
USE [master]
GO
/****** Object: StoredProcedure [dbo].[p_killspid] Script Date: 12/05/2012 11:42:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[p_killspid]
@dbname varchar(200)
as
declare @programName nvarchar(200),
@spid nvarchar(20)
declare cDblogin cursor for
select cast(spid as varchar(20)) AS spid from master..sysprocesses where dbid=db_id(@dbname)
open cDblogin
fetch next from cDblogin into @spid
while @@fetch_status=0
begin
IF @spid <> @@SPID
begin
exec( 'kill '+ltrim(@spid))
end
fetch next from cDblogin into @spid
end
close cDblogin &