日期:2014-05-18 浏览次数:20516 次
insert into tba (Aid,name) values ("101","AA") insert into tbb (idb,price) values ("101","BB")
begin tran insert into tba (Aid,name) values ("101","AA") insert into tbb (idb,price) values ("101","BB") commit tran
------解决方案--------------------
create table tba(aid int,name varchar(10)) go create table tbb(idb int,price dec(18,2)) go begin tran insert into tba (Aid,name) values ('101','AA') insert into tbb (idb,price) values ('101','BB') commit; --select * from tba --select* from tbb begin tran insert into tba (Aid,name) values ('101','AA') insert into tbb (idb,price) values ('101','12') commit; --select * from tba --select* from tbb
------解决方案--------------------
set xact_abort on begin tran insert into tba (Aid,name) values ("101","AA") insert into tbb (idb,price) values ("101","BB") commit tran