Using Variables at package level

  • Can we create a variable at package level and set default value as query string

    I mean Name as Table
    DataType as String
    Value as select * from emp

    Can we hardcode like this?

  • I feel like this question isn't as simple as I think it is, however, in your Variables Pane you have a column called Value. You can enter the value of the variable in there. That will be the default value of the variable when the package runs.

    There is also a column called expression, which can be used to create derived default values.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Yes. Then you would just set the SQLSourceType to Variable and pick your variable as the SourceVariable in the Task Editor. The value will stay unless it's overwritten by an expression or parent package variable.

  • Thom A - Tuesday, February 7, 2017 7:54 AM

    I feel like this question isn't as simple as I think it is, however, in your Variables Pane you have a column called Value. You can enter the value of the variable in there. That will be the default value of the parameter when the package runs.

    There is also a column called expression, which can be used to create derived default values.

    Rather than 'parameter', I think you meant 'variable' here ... it's quite an important distinction in this context.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Phil Parkin - Tuesday, February 7, 2017 8:41 AM

    Thom A - Tuesday, February 7, 2017 7:54 AM

    I feel like this question isn't as simple as I think it is, however, in your Variables Pane you have a column called Value. You can enter the value of the variable in there. That will be the default value of the parameter when the package runs.

    There is also a column called expression, which can be used to create derived default values.

    Rather than 'parameter', I think you meant 'variable' here ... it's quite an important distinction in this context.

    2 out of 3 times. >_< (I was distracted by someone asking me a rather daft question while posting that). Corrected my initial post.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

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

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