I'm wondering if there is a way to terminate SQL process when an error is raised an catched in Azure datawarehouse.
For example:
BEGIN TRY
PRINT 'a';
THROW 60000,'xyz',1
PRINT 'b'
END TRY
BEGIN CATCH
Print 'catched'
END CATCH
Print 'c'
Print 'd'
The output of the current code is: a, catched, c, d.
The desired output is a, catched. Also I'll be wrapping the try-catch block inside a while loop and printing 'c', 'd' will be outside it.
I tried "SET NOEXEC OFF", but is not working in Azure datawarehouse.
EDIT: The entire logic will be in a stored procedure
Can anyone please help me with this?
Thank you!