March 3, 2011 at 7:22 am
Hi
I have to load flat file to a table. Flat file contains data like
servers,data,1,2
,data,3,4
,MDa,5,7
Computer,lld,34,56
.......
.........
.....
If the 1st column is NULL, I have to duplicate the data in previous column. I mean data entered in to the table should be like
servers,data,1,2
servers,data,3,4
servers,MDa,5,7
Computer,lld,34,56
Can any body help me in this regard
March 3, 2011 at 9:17 am
You'll have to use a script component to do that.
You need to keep the value of the first column of the previous row in a variable and check the value of the current row.
If it is null (Nothing in VB.NET), then you replace it with the value of the previous row otherwise update the variable with the current value.
Here you can find an example of how to code an asynchronous script component:
http://msdn.microsoft.com/en-us/library/ms136133.aspx
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
March 4, 2011 at 1:58 am
thanks koen
Its really helpful
March 4, 2011 at 2:00 am
chowdarysurendranath.c (3/4/2011)
thanks koenIts really helpful
Great, glad to help.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply