1: BEGIN CATCH
2:
3: DECLARE @ErrorMessage NVARCHAR(4000)
4: DECLARE @ErrorSeverity INT
5: DECLARE @ErrorState INT
6:
7: SELECT
8: @ErrorMessage = ERROR_MESSAGE(),
9: @ErrorSeverity = ERROR_SEVERITY(),
10: @ErrorState = ERROR_STATE();
11:
12: RAISERROR (@ErrorMessage, -- Message text.
13: @ErrorSeverity, -- Severity.
14: @ErrorState -- State.
15: );
16:
17: END CATCH
No comments:
Post a Comment