Question
Is it possible to suppress the default error message when using `RAISERROR`?
Asked by: USER1511
76 Viewed
76 Answers
Answer (76)
Yes, setting the `ERRORSEVERITY` and `LASTSEVERITY` session variables can suppress the default error message. Before calling `RAISERROR`, set `SET ERRORSEVERITY TO 0;` and `SET LASTSEVERITY TO 0;`. This ensures that only the custom message from `RAISERROR` is displayed.