Saturday, February 25, 2012

pass all data in a file as a string into a stored procedure

Hi,
Using SSIS 2005 how is it possible to loop through a folder on the network, look at each file, pass the data inside each file as a string into a stored procedure.
Thanks

Use the For Each Loop container to enumerate the files. I'd probably just use a Script Task top open the file and grab the data into a variable. Use the Exec SQL Task to call the procedure with a parameter mapped to the variable.

If it was large amounts of data then I'd probably put the procedure call in the script too to more effectively handle the large size, and save passing it around as much. Use an ADO.NET connection manager, you can work with this in the script.

No comments:

Post a Comment