[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-02-09
5
Medium Priority
?
2,265 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.
0
Comment
Question by:PKTG
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:PedroCGD
ID: 23596046
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
0
 

Author Comment

by:PKTG
ID: 23602270
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.
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 23602328
ok.. just a moment!
0
 
LVL 22

Accepted Solution

by:
PedroCGD earned 2000 total points
ID: 23603269
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
0
 

Author Comment

by:PKTG
ID: 23603306
Thanks so much. I will try and let you know ASAP.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

834 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