create proc sp_Test
as
begin
begin transaction
begin try
--sql语句省略
end try
begin catch
if(@@TRANCOUNT >0)
insert into tb_error (Message)values(ERROR_MESSAGE())--这句永远不会执行 有谁知道请留意
rollback transaction
end catch
if(@@TRANCOUNT >0)
commit transaction