Input Rows and Add Addtional Rows on Output
I have an assignment where I would need to split data and add rows. I'm using the Script Component. The following is what I need to transform which is one row of data. What my professor has asked me to do is split the data and add rows. What he stated would
need to be done is to use both REG EX and C#. Is this even possible? I am only used to spliting one row individually and not adding additional rows. Below is how he wants to see it.
{"ReceiptIssued":"false","Appointments"[{"AppointmentNumber":"32335","AppointmentType":"Nail","Scheduled":true,"Confirmation":true},{"AppointmentNumber":"32336","AppointmentType":"Facial","Scheduled":true,"Confirmation":true}{"AppointmentNumber":"32337","AppointmentType":"Massage","Scheduled":true,"Confirmation":true}]
ReceiptIssued AppointmentNumber AppointmentType Scheduled Confirmation
No 32335
Nail Yes Yes
32336
Facial Yes Yes
32337
Massage Yes Yes
May 5th, 2011 2:32pm
Hello,
Declare Some Array and then save the data into Array
http://msdn.microsoft.com/en-us/library/aa288453(v=vs.71).aspx
Sorry if I misunderstood your question.
Can you please explain little more about your requirement.
EDITED: IF you are looking to take an input row and split it and convert to multiple columns then please visit this link
http://www.sqlis.com/sqlis/post/The-Script-Component-as-a-Transformation.aspx
Thanks
http://sqlage.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
May 5th, 2011 2:43pm
Yes doable, a classic row splitting using RegEx, but I do not see any SSIS involvement here
The C# code would be an equivalent to this VB sample: http://www.vbforums.com/showthread.php?t=399559Arthur My Blog
May 5th, 2011 2:48pm
Here's the Whole Information which I get from the CSV file my professor gave me. The idea is to split into array for each column and add rows. My understanding is the In BI SSIS it usually read each row before going to the next row. Like a 1 to 1 flow. So
when he stated that one column will have additional rows I just looked at him confused and thought this was not possible. That's when he stated I would need to use bothe REG EXP and C# and do a match. Here's what he's looking for the output to look like.
ID ReservationTime CompletedTime RepName AppointmentNumber AppointmentType Scheduled ConfirmationSent
29 11/3/10 10:00am 11/3/10 12:30pm Sarah 32335 Nail
Yes Yes
32336 Facial Yes
Yes
32337 Massage Yes
Yes
121 11/3/10 10:00am 11/3/10 12:30pm Kim 32338 Nail Yes
Yes
32339 Facial Yes
Yes
32340 Massage Yes
Yes
ID ReservationTime CompletedTime RepName Appointment
29 11/3/10 10:00am 11/3/10 12:30pm Sarah {"ReceiptIssued":"false","Appointments"[{"AppointmentNumber":"32335","AppointmentType":"Nail","Scheduled":true,"Confirmation":true},{"AppointmentNumber":"32336","AppointmentType":"Facial","Scheduled":true,"Confirmation":true}{"AppointmentNumber":"32337","AppointmentType":"Massage","Scheduled":true,"Confirmation":true}]
121 11/3/10 11:00am 11/3/10 13:00pm Kim {"ReceiptIssued":"false","Appointments"[{"AppointmentNumber":"32338","AppointmentType":"Nail","Scheduled":true,"Confirmation":true},{"AppointmentNumber":"32339","AppointmentType":"Facial","Scheduled":true,"Confirmation":true}{"AppointmentNumber":"323340","AppointmentType":"Massage","Scheduled":true,"Confirmation":true
Free Windows Admin Tool Kit Click here and download it now
May 5th, 2011 4:17pm
You can use a script component to do this, but you have to set it up as an
Asynchronous Script.
Talk to me now on
May 6th, 2011 11:25am
Thank you very much. I kept googling and reading and it was driving me bonkers. I finally read something last night about Ansynchronous Script. I'm still learning and appreciate the guidance. Now to impress my professor! :)
Free Windows Admin Tool Kit Click here and download it now
May 6th, 2011 1:42pm


