Hi Experts ..
I have a procedure similar to the one I posted bellow, and I am trying to catch the exception from C# method to determine if the exception was thrown from within the IF block or not.
I want to build the application logic based on that .. do you have any idea how to do it?
CREATE PROCEDURE spAddSomething
@ID BIGINT OUTPUT,
IF (NOT EXIST(SELECT [ID] FROM TableX WHERE [ID] = @AnotherID))
RAISERROR ('The passed Another Id odes not exist in persistence.', 16, 1)
.. insert statement