这样简单的存贮过程也死锁,没天理
procedure pxxx
@syssign varchar(2)
as
begin tran
update table1 set pa1=pa1+1 where xx=@syssign
select pa=pa1 from table1 where xx=@syssign
commit tran
过年前没死锁,年后开始了。请问如何解决
------解决方案--------------------select pa=pa1 from table1 where xx=@syssign
-----------------------------------------
pa是@pa吧?
------解决方案----------------------try
create procedure pxxx
@syssign varchar(2)
as
begin tran
update table1 set pa1=pa1+1 where xx=@syssign
commit tran
select pa=pa1 from table1 where xx=@syssign
------解决方案--------------------测试了没问题
不知道楼主是在并发度多大的环境出现死锁的
------解决方案----------------------try:
procedure pxxx
@syssign varchar(2)
as
begin tran
update table1 set pa1=pa1+1 where xx=@syssign
select pa=pa1 from table1 with (XLOCK) where xx=@syssign
commit tran