Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. DECLARE @ErrorMessage NVARCHAR(4000);
  2. DECLARE @ErrorSeverity INT;
  3. DECLARE @ErrorState INT;
  4.  
  5. SELECT
  6. @ErrorMessage = ERROR_MESSAGE(),
  7. @ErrorSeverity = ERROR_SEVERITY(),
  8. @ErrorState = ERROR_STATE();
  9.  
  10. -- Use RAISERROR inside the CATCH block to return error
  11. -- information about the original error that caused
  12. -- execution to jump to the CATCH block.
  13. RAISERROR (@ErrorMessage, -- Message text.
  14. @ErrorSeverity, -- Severity.
  15. @ErrorState -- State.
  16. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement