34,837
社区成员




create table 表a(name varchar(20) not null)
create table 表b(name varchar(20))
begin try
begin tran
insert into 表a select 'a'
insert into 表b select 'c'
commit tran
end try
begin catch
rollback
end catch
--全部插入
begin try
begin tran
insert into 表a select null
insert into 表b select 'c'
commit tran
end try
begin catch
rollback
end catch
--全部回滚
select * from 表a
select * from 表b