Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Chad
  •  Chad
  • Paid support Topic Starter
2018-04-30T14:41:17Z
I have a task that gets a the items in a sharepoint list and outputs them in tab delimited format.
I'd like to take the results and UPSERT them into a SQL table. I can write a query that does a MERGE to insert/update the line if it's there, but not sure how to loop through each line of the results and use each tab delimited field in the SQL query.

Any ideas?

Example of the data I'm getting from SP.
"Title" "Partner_x0020_ID" "Partner_x0020_Type" "Market_x0020_Access_x0020_Contac" "Ship_x002d_To" "Payer" "ID" "Modified" "Created" "Last_x0020_Modified" "Created_x0020_Date"
"My Partner Name" "1" " My Partner Type" "John Doe" "1063494" "3000853" "1" "4/23/2018 6:58:59 PM" "4/23/2018 6:58:59 PM" "2018-04-23T18:58:59Z" "2018-04-23T18:58:59Z"

Thanks,
Chad
Sponsor
Forum information
Chad
  •  Chad
  • Paid support Topic Starter
2018-04-30T14:43:20Z
I know I could write to a file and then use something like SSIS to import, but feels like I shouldn't have to do that.
Chad
  •  Chad
  • Paid support Topic Starter
2018-04-30T15:37:20Z
Was able to do this by adding a task loop on the SQL task using for each x in y that points to the job - task - output for previous task.
on sql task - starting with something like this to get it in. Note the single quotes are necessary.
INSERT INTO STG_INDIRECT_PARTNERS(PARTNER, PARTNER_TYPE)
VALUES('{LOOP(CurrentValueXArray|0)}','{LOOP(CurrentValueXArray|2)}')
Scroll to Top