tags:

views:

366

answers:

1

I am using Excel to generate a whole slew of INSERT statements, similar to the process described here.

I would like to have an SSIS package that will run through each row of this excel file and run the SQL statements it finds against a database.

Is this possible?

EDIT:

As John points out - there is a better way to do it - generate the insert statement in SSIS instead of Excel. (I'm just getting my head into SSIS).

+3  A: 

I'm sure it's possible, if a little silly. Why not generate the INSERT statements inside of SSIS?

At any rate, I suppose you'd get an Excel connection manager, use it in an Execute SQL Command task to SELECT the column with the INSERTS from Excel, and output the results to a Recordset. You'd then use a ForEach task to iterate over the recordset, putting each INSERT into a variable. Use the variable to configure an Execute SQL Task inside the ForEach task.

John Saunders
+1 because you led me to how to do something different using the Execute SQL component.
RolandTumble