How to use IDENT_Current function on multiple identity columns table

  • I want to get the latest inserted record from target table and update the field in source table.

    Source:

    Name company targetID

    Jane YYYY Null

    Basically, I am looping the files in SSIS and inserting the target tables via webservice(script task). Each record is created per file . I want to capture the latest ID created in target and update the source field.

    Target:

    ID name company

    1 Jane YYYY

    after the row is created in target for a file, I want my source to be Source:

    Name company targetID

    Jane YYYY 1

    If the row is not created ,then do not update source.

    I checked for scope_identity(),ident_current but not sure how to use them in my situation as I am inserting target tables via webservice.

    Also, my target table can have more than 1 identity column. How do I use Ident_Column on this table?

    Any help is appreciated.

  • Also, my target table can have more than 1 identity column. How do I use Ident_Column on this table?

    Can you post the DDL for this table? I don't have a copy of SQL 2005 anymore but I am not sure that version allowed multiple identity columns on a table. Not sure any version allowed it so curious as to how you accomplished this.

    Sue

  • Pretty sure that you can only have one column in a table identified as an identity column.

Viewing 3 posts - 1 through 2 (of 2 total)

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