开发者

Bubble up error in a stored procedure

开发者 https://www.devze.com 2023-02-28 04:03 出处:网络
I am working on creating a SQL Server 2005 stored procedure that will call another stored proc, which in turn could call another stored proc. If an error occurs in the grandchild proc, is it possible

I am working on creating a SQL Server 2005 stored procedure that will call another stored proc, which in turn could call another stored proc. If an error occurs in the grandchild proc, is it possible to have the error bubble up 开发者_开发技巧to the parent?


Yes, you can do this with the BEGIN TRY ... END TRY BEGIN CATCH ... END CATCH construct in SQL Server.

0

精彩评论

暂无评论...
验证码 换一张
取 消