June 7, 2018 at 10:38 am
Hello Everyone,
How's Everyone doing? I hope all is well.
I have CSV file with a million rows that I need to split into 4 tables(250,000 rows to one table) and I can use your help. I want to use SSIS to upload the CSV file(split 4 ways) into 4 different tables). Can anyone help me with this please; Do I use a conditional split? And if so, what will be the expression written?
All ways to do this is appreciated.
Thanks in advance!
June 7, 2018 at 12:21 pm
I would use a script transform to do the conditional split.
http://www.sqlis.com/sqlis/post/Using-the-Script-Component-as-a-Conditional-Split.aspx
Assuming you want to use a round-robin row distribution technique, the code would look like this:
int rowCounter = 0
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
rowCounter += 1;
switch (rowCounter % 4)
{
case 0:
Row.DirectRowToOutput0();
break;
case 1:
Row.DirectRowToOutput1();
break;
...
}
}
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy