一存储过程:
create proc xx
as
begin tran
  update 表1.........
  declare @str nvarchar(500)
  set @str=N'update 表2..........'
  execute sp_executesql @str
commit tran执行:set xact_abort on
exec xx
set xact_abort off如果执行中第二个update出现错误,为什么不能自动回滚至起点,只是回滚了
这一条语句?如果存储过程是这样:
create proc xx
as
begin tran
  update 表1.........
  update 表2..........
commit tran执行:set xact_abort on
exec xx
set xact_abort off如果执行中第二个update出现错误,却能自动回滚至起点,这是为什么啊?