What is the best way to update a table from a List inside an SSIS Script Task?
We have a shared class library. I have used the dll in the script task to do most of the necessary work. The dll method then returns a List which contains data related to the processes that it ran. It is my job to write this list to a table.
I'm thinking I will loop through each item in the List and and run the update SQL statement.
For brevity, I did not paste the SQL statement, but it is actually an Upsert using MERGE.
Actually, I wish there were a way to output the List to the input of an Execute SQL Task, but I'm unsure if that is possible.
Here is what I have so far. As you can see it is unfinished.
private void UpdateEtlData(List<ProcessStatitics> statistics)
var connection = GetOhioConnectionString();
// will loop thru each item in statistics and run the
// following sequence. This code is unfinished, but
// I will use properties inside each statistic to form the
foreach(statistic in statistics)
SqlCommand command = new SqlCommand();
command.Connection = connection;
command.CommandText = ""