How to create uniqueid(identity column) while importing one text file to another text file with SSIS?

Posted on 2009-02-09
Last Modified: 2013-11-10
Can you please tell me how to create unique id like identity column value with seed 1 while importing one text file to another text file with SSIS package?

Files has 40 columns and around 50000 records. But these files doesn't have any unique column. So i need to create unique column like identity column with seed 1 before loading into database.  So i plan to create another flat file (destination file) along with identity column . Can you please advise me how to do this? My destination database is Netezza and cureent version doesn't have identity column concept.Thanks.
Question by:PKTG
    LVL 22

    Expert Comment

    Add inside your dataflow, a Script component as transformation to increment a SSIS Variable with 1 for each row.
    You need to create SSIS variable
    Add a dataflow and inside:
    Add a source
    Add a derived column
    Add a Script as transform
    Add a destination


    Author Comment

    Thanks. I am new for SSIS . So can you please explain little bit more or if you have any example script please send me. Thanks again.
    LVL 22

    Expert Comment

    ok.. just a moment!
    LVL 22

    Accepted Solution

    Here you have.
    Create a new SSIS Project
    Add the attached dtsx package to the solution
    Update connection to excel (cmExcel)
    And test it!


    Author Comment

    Thanks so much. I will try and let you know ASAP.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now