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