TSQL TRY CATCH

BEGIN TRANSACTION
BEGIN TRY
	--[QUERIES HERE]
COMMIT TRANSACTION
END TRY

BEGIN CATCH
	ROLLBACK TRANSACTION -- Cancel transaction if an error has occurred

	DECLARE @Msg NVARCHAR(MAX) 
	SELECT @Msg=ERROR_MESSAGE()

	RAISERROR('Error Occured: %s', 20, 101,@msg) WITH LOG
END CATCH
0
2