Monday, March 19, 2012

BUG REPORT: ReadWriteVariables different between Script Task and Script Component

I have just spent two hours banging my head off the wall to figure this one out... wondering if I had a problem with variable scope or something...

I had a Script Task which was taking a few package level variables to use in the script.

So I put the list of variables in the ReadWriteVariables property.

Specified them like this:

"User::FileBeingProcessed, User::FileSource"

And all was well....

Then later on decided to use the same set of variables in a Script Component contained in a Data Flow.

And kept kept getting a "..variable not found.." error dialog when I clicked on Design Script.

Finally the solution came to me: Spaces in the list of variables !

In a script task you can have a space after a comma in the list... but in a script component you CAN'T !!

So what works in a Script Task is :

Task : "User::FileBeingProcessed, User::FileSource"

But that will not work in a Script Component...

See the difference?:

Task :"User::FileBeingProcessed, User::FileSource"
Component:"User::FileBeingProcessed,User::FileSource"

I know the BOL says to use a comma separated list.. but.. some consistency would be nice...

PJ

I agree..that's a bit...err...cra@.p!

I always thought both used the syntax without a space in there and hence that what I always use - and hence I never have a problem with it.

Bug it! http://lab.msdn.microsoft.com/productfeedback/default.aspx

-Jamie

|||

Oh yeah, if you worked without the spaces you'd never see the problem... its just if you're an awkward fecker like me... heh heh...

Very misleading tho.. I was thrashing around for ages worried about scope (since the Script component is only down inside a data flow) and then applying service packs.. etc...

Still.. yer eventually glad just to find out yer not going crazy...

heh,

PJ

No comments:

Post a Comment