2
@error行在这里是否有意义?它会在错误情况下被击中吗?如果try块中有多个sql语句,每个sql语句都跟着一个类似的检查,会发生什么?在sql server中同时使用@@ error和try ... catch错误处理是否合理?
begin try
Select a,b from tableC where a > 3 and b < 2
Set @error = @@error
If @error <> 0 begin raiseerror("error",16,1)end
end try
begin catch
select error_message()
end catch