to:w_rose(w_rose) 不知道3GL思想是什么思想 我写了一个存储过程流程如下: create proc myproc as begin tran a update table set f1=1,f2=3 exec other_proc1 p1,p2 out //调用别外一存储过程,根据p2返回值决定继续还是回滚 if(p2 <>1) begin select message='error' rollback tran a end insert into table2 (...)values(....) if(@@rowcount <>1) begin select message='error' rollback tran a end exec other_proc2 p1,p3 out //调用别外一存储过程,根据p2返回值决定继续还是回滚 if(p3 <>1) begin select message='error' rollback tran a //我的问题就是如果在这回滚的话是否对other_proc1内部 //事务进行回滚? end delete table where .... if(@@rowcount=1) begin commit tran a select message='ok' return end else begin rollback tran a select message='error' return end
不知道3GL思想是什么思想
我写了一个存储过程流程如下:
create proc myproc as
begin tran a
update table set f1=1,f2=3
exec other_proc1 p1,p2 out //调用别外一存储过程,根据p2返回值决定继续还是回滚
if(p2 <>1)
begin
select message='error'
rollback tran a
end
insert into table2 (...)values(....)
if(@@rowcount <>1)
begin
select message='error'
rollback tran a
end
exec other_proc2 p1,p3 out //调用别外一存储过程,根据p2返回值决定继续还是回滚
if(p3 <>1)
begin
select message='error'
rollback tran a //我的问题就是如果在这回滚的话是否对other_proc1内部
//事务进行回滚?
end
delete table where ....
if(@@rowcount=1)
begin
commit tran a
select message='ok'
return
end
else
begin
rollback tran a
select message='error'
return
end