• TRY CATCH is used for error handling while IF is used for conditional logic.

    IF (Some Condition)

    BEGIN

    -- run these statements if your condition is true

    END

    ELSE BEGIN

    -- run these statements if your condition is false

    END;

    BEGIN TRY

    -- run these statements

    END TRY

    BEGIN CATCH

    -- only run these statements if an error occurred above

    END CATCH;

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]