• But the try-catch approach is probably the better one. Something like this:

    BEGIN TRY

    INSERT INTO tblCustomer (cid, lName, fName)

    SELECT @cid, @lName, @fName

    END TRY

    BEGIN CATCH

    IF error_number() = 2627 UPDATE tblCustomer SET lName=@lName, fName=@fName WHERE cid=@cid

    END CATCH

    It seems to work...