SSIS Loop /script

  • Hi,

    Im continuing on from a previous series of posts about SSIS just a run down I'm only a begginer trying to get this all to work...

    I've created a For Loop that will go through my variable "Filecount" which is an Integer cycling through 1 to 5. which was basic but I now need to write a script that when i go through the file count each file count represents a folder so , Filecount1 = 'FolderTest", Filecount2 = 'FolderPracticeTest" etc

    I have no experience in vb.net scripting so its not my strong point... I read about a case statement but can't seem to get it working in scripting component ?any help at all be appreciated.

  • This could end up complex. Can you link here to your previous posts so I can try to get an idea of what else you've built so far so I (we) can have a reference point?

    However, the short version to what you're going to need to do is replace your For Loop with a For Each Loop.

    Now, on the Collection tab (on the left) change the Enumerator into Foreach Item Enumerator. Then, at the bottom, hit columns, and hit add twice. Set Column0 to your int and Column1 to your Foldername (as a string). Click OK.

    Now you've got a small grid, just type in your 1/folder, 2/folder... create your list like you would in Excel.

    Now, go to Variable Mappings tab. Hit the dropdown and pick one of your variables for the int, and leave that as index 0. Then do the same for your foldernames, and use that as index 1.

    From there, apply your variables as you need to in the expressions on the different objects.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • sorry what i meant was previous posts on SSIS were for other projects i've created around expressions - this is a new SSIS project i'm creating.

    I'll try the ForEach instead of the ForLoop give that a try

Viewing 3 posts - 1 through 2 (of 2 total)

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