How can I read a file and then update before insert to table?
I have a SSIS process that reads a file for a bulk load but requires a id that the application adds +1. The issue I have is how in SSIS can I get the max id from destination and inject that into the flow between reading the file and inserting into
table?
File:
NAME
TEST
TEST
TEST
GET MAX NUM = 3
Insert End Result:
NAME, NUM
TEST, 4
TEST, 5
TEST, 6
Does this makes since? I know this is a crapy explanation :) I hope someone understands :).Thanks, Matt
April 21st, 2011 5:41pm
Use an Execute SQL Task prior to the Data Flow Task you use to read the text file. Read the MAX value and store it in an SSIS variable. In the Data Flow, you'll have to use a
script or
Row Numbering transform to add the sequence number to your flow.
Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
April 21st, 2011 6:00pm
Here is an other example:
http://microsoft-ssis.blogspot.com/2010/01/create-row-id.html
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
April 22nd, 2011 12:28am