SSIS Variable Suggestion

  • Hello Everyone

    I am no longer seeing the SSIS category any longer, so I am posting the question here.

    What type of variable in SSIS would I use to hold a small list. The data will be a list of file names? Only about 5 names at the very most would be stored. I honestly don't expect but one single name per day, but this is in case something gets misses and there happen to be a couple files in that directory. I need to make allowances for that.

    Thank You in Advance for your assistance and suggestions

    Andrew SQLDBA

  • Can you store your list in a table and have the package reference the table?

    Other wise you will need to parse out the individual data items from you list, certainly feasible but more complicated in my opinion.

    If you are trying to take some action to an unknown amount of files a Foreach Loop might be the way to go.

  • Yes, I can use a table, but I need to store each one in an array, or something until the step to insert the list into a table.

    Andrew SQLDBA

  • Using a Script Task in SSIS, what is the best way to gather a list of file names? There will be an unknown number, but certainly less than 5.

    Or can anyone suggest a better way to get the list of file names in a directory in SSIS?

    Andrew SQLDBA

  • The Foreach Loop method is the standard, out of the box way to retrieve and act on an indeterminate number of files in a folder. It will retrieve each filename in a folder and then you could pass each filename to a Script task if needed.

    I imagine you could build a Script task to do what the Foreach Loop does but I don't have any specifics on that since I have always used Foreach Loop to enumerate files in a folder.

  • Thanks

    I have got that part.

    I am trying to get the file name out of the Array, and assign the value to a variable.

    How can I do that using C# in the Script Task?

    Andrew SQLDBA

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply