How to retrieve the IDENTITY of the ROW if the 'IF EXISTS' function return a TRUE

  • John Peter Fernandes (5/3/2010)


    Sergiy.. thanks for this, this returns the value of the new TagId if inserted and the TagId of the already existing Tag.

    however if it exists i get the TagID and a '0' and if it does not exist i get the new TagId and a '1'.

    is there some way i can output only the TagId and not the result of the IF EXISTS

    Are you sure you tried the code?

    You get actual ID for the tag in any case.

    _____________
    Code for TallyGenerator

  • i really need to apologize this time..

    im writing this in a .net and i had it in a Class library that was returning the output as 0 - passed and -1 - failed.

    i removed it to return the Output and it works just fine..

    thanks a ton guys..

    and sorry for messing it up.

    John P Fernandes
    Enterprise Premier Support | Networking | Microsoft India GTSC

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply