I HAVE FOLLOWING CODE STRUCTURE.
BEGIN TRY
IF EXISTS(CHECK IF VALUES EXISTS)
BEGIN
DO SOMETHING
END
END TRY
BEGIN CATCH
LOG ERRORS INTO TABLE
END CATCH
with the above structure. If i just run if exists it is wokring fine. If i run whole code it keeps on running and it never stops. Not sure if there is something wrong with code. Let me know if this is the correct way or if there is better approach for this.
Thanks in advance