请问系统存储过程sp_cursorfetch是做什么用的?

shysky 2003-08-22 11:45:47
最近数据库经常生spid阻塞,查看阻塞的进程属性一看大部分是“sp_cursorfetch;1”,可以把这个系统存储过程删掉么?
...全文
290 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
shysky 2003-08-22
  • 打赏
  • 举报
回复
在 master --扩展存储过程里面
txlicenhe 2003-08-22
  • 打赏
  • 举报
回复
不是系统存储过程
pengdali 2003-08-22
  • 打赏
  • 举报
回复
use master
go
create proc killspid (@dbname varchar(20))
as
begin
declare @sql nvarchar(500),@temp varchar(1000)
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
set @temp='kill '+rtrim(@spid)
exec(@temp)
fetch next from getspid into @spid
end
close getspid
deallocate getspid
end

--用法
use master
exec killspid '数据库名'
caiyunxia 2003-08-22
  • 打赏
  • 举报
回复
1、没有系统存储此过程
2、系统存储过程不能删除
CrazyFor 2003-08-22
  • 打赏
  • 举报
回复
是不是你的存储过程,好象不是系统存储过程啊.:)

34,576

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧