Dynamically setting a variable from an 'execute package task'...

  • Hello - does anyone know how to do undertake this seemingly simple task? To dynamically set a global variable when the control flow hits an 'execute package task'. Expressions only allow you to set properties, not variables. Scripting in my case is cheating - not allowed. Any ideas? I'm sure it's staring me in the face - but i'm failing dismally at the mo. Thanks...

  • Use an Execute SQL Task and write a sql statement simular to this:

    select 1 as result

    Then in the result set tab (you will find this on left side of editor window) click the add button and enter the field name in the Result Name column in this case result. In the Variable Name column choose your global variable or you can also create a new one here.

    hope this helps.

  • Thanks Mark - that worked fine. Is this the standard way of setting variables or would this be considered a work-around? For the production system, I want to ensure that the methodologies used will be implemented as standard as possible. Obviously a newbie to this, but it seems odd to have to return an SQL literal to alter a variable value. Or would this normally be done via a script? Thanks...

  • I am relatively new to this as well and I have found this process works well. As far as standardization not sure what the considered standard is for this I do no some folks in my office have used vb script to do this as well. As with most things in development there is more than one way to get to your result. If you find a standard for this please share.

    Glad I could be of some help.

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

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