Using GOTO instead sql query statement.

SET @vcMessage = 'Go to cleanup';
GOTO Cleanup;

---------------------------------------------------------------
-- Cleanup
---------------------------------------------------------------
Cleanup:

--Logging
SET @vcMessage = 'Completed' + CASE WHEN @iReturnCode = 0 THEN ' successfully.' ELSE ' with errors.' END;

RETURN @iReturnCode;
Last modified: September 28, 2021

Author

Comments

Write a Reply or Comment