question

simpleTon avatar image
simpleTon asked

SSIS Variables in For Loop

I am trying to run a discrete extract for six consecutive months. I have set a Global variable @[User::startDate] at the package level. I have Configured the for loop as follows: InitExpression = @[User::startDate]=DateAdd("MM", -9, GETDATE()) EvalExpression = @[User::startDate]
ssisvariables
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

simpleTon avatar image
simpleTon answered
OK - it seems it was the Activ X script causing the problem All fixed now Thanks folks
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Usman Butt avatar image Usman Butt commented ·
Can you please add more details? It could help any other user's cause in future. Thanks.
1 Like 1 ·
Usman Butt avatar image
Usman Butt answered

Can you please give more details about your package? Is the variable made available to the Script Task either as ReadOnly or ReadWrite? If there are check points enabled, have you tried deleting the checkpoint file? Are there any parallel components running and trying to work on this variable?

6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

simpleTon avatar image simpleTon commented ·
Hi - it's very early days yet. Eventually the for loop container will have a number of datapumps, sql srcipts and procs for validation and manipulation, but at this stage I simply have a VB.net script which should pop up a message box with the startDate in it.. . . . but it won't even do that yet. No check points or debug breaks as yet.
0 Likes 0 ·
Usman Butt avatar image Usman Butt commented ·
If you are accessing the StartDate in the script, then try replacing it with a hard-coded string. If possible, share the script with us.
0 Likes 0 ·
Usman Butt avatar image Usman Butt commented ·
And please make sure that you are making the variable available to the script task either as readonly OR ReadWrite. Otherwise, it will give the same error.
0 Likes 0 ·
simpleTon avatar image simpleTon commented ·
Happy to do that when I get back to office tmrw, but essentially it's along the lines of dim myVar as string myVar= dts.variables("startDate").value.tostring msgbox myvar but the routine falls over at for loop container
0 Likes 0 ·
simpleTon avatar image simpleTon commented ·
I have it as read/write
0 Likes 0 ·
Usman Butt avatar image Usman Butt commented ·
Have you sorted it out?
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.