You can throw exception in try catch block:
DECLARE @msg nvarchar(50) = 'Here is a problem!' BEGIN TRY print 'First statement'; THROW 51000, @msg, 15; print 'Second statement'; END TRY BEGIN CATCH print 'Error: ' + ERROR_MESSAGE(); THROW; END CATCH
Exception with be handled in CATCH block and then re-thrown using THROW without parameters.
First statement Error: Here is a problem! Msg 51000, Level 16, State 15, Line 39 Here is a problem!
THROW is similar to RAISERROR with following differences: