Click here to Skip to main content
12,242,189 members (50,297 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# SSIS
Hi everyone,

I am working on one task which need to transfer data from text file to destination after applying some business logic.

Below is my text file data



employee_id salary
10 1000
20 2000
30 3000
40 5000

I need to add one more column to it called as "pre_row_salary" which will be salary of employee in above index as per above table.
Look below table for more information.First row contain NULL in "pre_row_salary" column because there is no-one above it.Second row contain 1000 in "pre_row_salary" which is salary of employee 10. Third row contain 2000 in "pre_row_salary" which is salary of employee 20(Upper rank).


employee_id salary pre_row_salary
10 1000 Null
20 2000 1000
30 3000 2000
40 5000 3000
Let me know how can I process this text file data with this business logic to the destination.
Posted 2-May-12 21:56pm
Edited 9-May-12 1:07am
RDBurmon10.1K
v4
Comments
Sandeep Mewara 3-May-12 5:00am
   
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

refer this website you will find out you requirements... http://www.sqlservercentral.com/Forums/Topic627016-298-3.aspx#bm632634[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You can use Script Component, add a new output column named pre_row_salary.
Then edit script to loop all record, set pre_row_salary in method ProcessInputRow.

Hope this will help you.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 12 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100