1.如何获取存储过程用return返回的值
declare @dddd int
exec @dddd=AllPlanManage_ReturnPlanBack 2006,12,19,15,2,1
print @dddd
2.如何判断SQL Server事务是否执行成功?
用系统常量@@error在执行每一个sql语句后的值来判断:
begin transaction
delete ...
if @@error<>0
begin
rollback transaction
return
end
insert into ...
if @@error<>0
begin
rollback transaction
return
end
commit transaction