sqlserver数据库还原存储过程脚本


存储过程必须要创建在系统数据库的master里
#from fhadmin.cn
create proc killspid (@dbname varchar(20))        
as        
begin         
declare @sql   nvarchar(500)       
declare @spid  int         
set @sql='declare getspid cursor for select spid from sysprocesses where  dbid=db_id('''+@dbname+''')'     
exec (@sql)     
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 
end  
本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
未填写
文章
234
粉丝
11
喜欢
34
收藏
35
排名:793
访问:8674
私信
所有博文
社区赞助商