Error Handling
System Errors
Custom Errors
EXEC sp_addmessage message_id, severity,
N'error_message'
GO;Raising Error with RAISERROR
RAISERRORRAISERROR ( { msg_id | msg_str | @local_variable }
{ ,severity ,state }
[ ,argument [ ,...n ] ] )
[ WITH option [ ,...n ] ]Raising Error with THROW
THROWTHROW [ { error_number | @local_variable },
{ message | @local_variable },
{ state | @local_variable } ]
[ ; ]@@ERROR
@@ERRORTRY...CATCH
Last updated