$Project varialbes?

  • I'm following a course in SSIS from PluralSight. In one module, an Execute Package task references a variable in the parent task like this:

    @[$Project::foo]

    where "foo" is a Project variable (new with SQL Server 2012)

    I'd like to know:

    1. Is this usage documented somewhere?

    2. are there other variable groups that can/must be accessed with the "$" format? e.g. can I refer to varialbes with names like @[$Package::Name] or @[$Parent::Name]?

    I'm looking for some reference docs on this.

  • There's quite a bit of documentation in books online, as well as blog posts on using the new features in 2012 SSIS.

    The $ sign is a new addition for accessing project and package scoped parameters.

    Variables, which existed before parameters, are accessed via @[User::<variablename>] and can have package, control flow, or even task level scoping.

    Accessing a project level parameter:

    @[$Project::<parameter_name>]

    Accessing a package level parameter:

    @[$Package::<parameter_name>]

    Lots of beneficial uses as long as you are willing to go the route of project deployments and not atomic package deployments.

    I.E. use a project level parameter for your connection strings for your project connection managers and you no longer have to worry about changing them in each package. Just add the project connection manager once to a package in a project, right click it and select parameterize and specify your project parameter and that's it. Now when you use it in other packages, it's already configured.

    Also very useful for dynamically setting working directories for separating out your log files, raw files, and pending and processed files.

Viewing 2 posts - 1 through 1 (of 1 total)

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