I have got a web service (*.amsx) that I should call it within a SSIS package by service component.
The web service returns some records and my mission is parsing every single record and do an appropriate action by looking at one of its fields (Action). So If it contains value ‘add’ I should insert that record into my Database and if it contains ‘edit’, I should update its contents in my Database.
Now, my question is : Is there any best practice for such these scenarios when parsing data?
In SSIS, do a dataflow where you get records from your source as the first part of the dataflow.
Next(within the same dataflow), do a condition split based on the value of the Action column you were referring to – this will parse your data into two separate flows – update, add/insert.
For records that are to be inserted, do an oledb destination.
For records that are to be updated, do an oledb command.
All that should take place within a single dataflow. I would recommend including a check for the existence of the ‘add’ records (by key) in the destination before you insert so you don’t get duplicates – that is if you would ever be running this package more than once.
Anyway, that’s the general idea.