超简单直接拿分,如何将2个插入语句放到一个事务中
超简单直接拿分,如何将2个插入语句放到一个事务中
日期:2021-06-15 09:00:42 人气:1
begin transcation;
insert into test values(5,'111111');
insert into test values(6,'111111111111111111111111111111111111');
if(@@error<>0)
rollback transcation;
else
commit transcation;
insert into test values(5,'111111');
insert into test values(6,'111111111111111111111111111111111111');
if(@@error<>0)
rollback transcation;
else
commit transcation;