Adding an identity column in SSIS

  • Hi all,

    I have a requirement to implement a surrogate key column in my SSIS package.

    Actually let me explain in detail:

    I have a DeptNO Column which I have to incerment everytime there is a New record found ( I have to lookup on DepName and increment the DepNo for every new DepNAme found)

    Now I tried to do this by using Execute SQL task to get the Last Max key from the DEPT table and then if its a new row from the lookup I was adding 1 to the Variable that stores the Max DEPNO key, but its not working, its giving all Depno the same value.

    Any help on this.

    Tahnks in advance

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

  • So you are adding data to an existing table using SSIS and it is in this table that you would like to auto-increment department?

    Why not use an IDENTITY field on the department table? Then SSIS is not really involved.


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

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