spliting the record based on SUBSTRING and FINDSTRING functions in ssis 2008

  • can someone help with the code in c# for the above scenario

  • ptejasree (12/13/2011)


    can someone help with the code in c# for the above scenario

    What do you have so far?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I mean in the C# script in post-execute, how to declare the columns

    Dept_L1,Dept_L2,Dept_L3,Dept_L4,Dept_L5,Dept_L6,Dept_7

    to get the respective values in between the "=+ form the source.

    "Futurewei Technologies, Inc.=N.A. Region=Usa=Products & Solutions=US Research Center=America Network Division=America Network Optical Dept"

    We cannot take the char postion as it varies, pnly significant one is take the values between "=" in the source

    to split to 7 columns.

    Hope this help to write the c# code

  • Did a bit of research (you can do this too, don't be afraid):

    http://msdn.microsoft.com/en-us/library/b873y76a.aspx

    Split the string using = as a delimiter. You get the substrings in an array.

    Loop over this array and add each substring to one of your output columns.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I can use if it is a single row to split the data.

    But in my case from my source file, there is "Department" column which has more than 3000 rows with different data. So i need to split each row based on "=" delimiter.

    so in the code how to take the column name so that all the rows will be processed at a time and split

    into 7 different columns

  • Look at the example in the article that I provided you.

    If you use the ProcessInputRow(row) method, you are processing the data row by row. You just need to call the split function on the column of the current row and then output the results to the corresponding outputs.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply