• 您的位置我爱Aspx >> 数据库 >> 锁的问题
  • 锁的问题

  • 作者:aspxer  来源:internet  日期:2007-5-22 0:33:10  关键字:
  • 锁的问题

    >

    现在老是出现这样的错误提示!

    -2147467259 Your transaction(process ID #30) was deadlocked with another process and has been chosen as the deadlock victim.Return your transaction.

    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 @#数据库名@#

    我对这篇文章有话说?
  • 广告位招租,广告代号:content_468_15
  • 上一篇:sqlserver中怎么对text、ntext和image操作
    下一篇:怎么清除sqlserver日志
  • 相关文章