BEGIN CATCH
DECLARE @error_message NVARCHAR(MAX)
SET @error_message = ERROR_MESSAGE()
DECLARE @error_severity INT
SET @error_severity = ERROR_SEVERITY();
DECLARE @error_state INT
SET @error_state = ERROR_STATE();
IF @error_state = 0 SET @error_state = 1
IF XACT_STATE() <> 0 ROLLBACK TRAN
-- do error handling here

-- pass error back to client
-- if it cannot be handled
RAISERROR (@error_message,
	@error_severity,
	@error_state)
END CATCH
a
b
c
