We help IT Professionals succeed at work.

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

PKTG
PKTG asked
on
Medium Priority
2,424 Views
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.
Comment
Watch Question

Commented:
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

helped?
Regards,
pedro

Author

Commented:
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.

Commented:
ok.. just a moment!
Commented:
OK..
Here you have.
Create a new SSIS Project
Add the attached dtsx package to the solution
Update connection to excel (cmExcel)
And test it!
helped?
regards,
Pedro
www.pedrocgd.blogspot.com


SSIS-Interface.JPG
Package-EE85-dtsx.txt
SourceData.xls

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks so much. I will try and let you know ASAP.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.