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.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • 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