Online: 5133
To return custom error message in case of error, we pass necessary parameter to the THROW statement.
--- SELECT 'ITFunda'/0
BEGIN TRY
SELECT 'ITFunda'/0
END TRY
BEGIN CATCH
THROW 50001, 'Always use integer to divide by', 1
END CATCH
Throw has three parameters,