Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

SQL Server, T-SQL, BI and more...
Browse by Tags · View All
ssis 26
SSIS 26
SQLServerPedia Syndication 19
Business Intelligence 14
T-SQL 13
ssrs 10
SSRS 10
General 9
SSAS 8
sqlpass 4

Archive · View All
January 2012 14
April 2012 5
March 2012 5
February 2012 5
November 2012 3
October 2012 3
June 2012 3
May 2012 3
August 2012 2
July 2012 2

Sam Vanga's Blog

Change Package Properties Using Parameters–SSIS 2012

Apr 24 2012 12:00AM by Samuel Vanga   

In DTS, changing package properties was close to impossible (the less we talk about DTS, the better). Package configurations introduced in 2005 solved most of the problems. In 2012, SQL Server Integration Services introduces parameters to make this process even easier. Parameters allow you to change package properties without the need for configuration files.

In this example, we will create a variable and change it’s value at run time using parameters.

Let’s enter the Demoland!

In a SSIS package, I created a variable called PromptValue. I assigned the value “I’m Variable” to it.

SSIS Parameters 2012

Next, I added a script task to the package, entered PromptValue as a read only variable, and used the following script.

MsgBox(Dts.Variables(“PromptValue”).Value.ToString)

I see the following message box when I execute the package.

SSIS show messgae box

Now, we want to be able to change this value during execution. Here is where we would create a package configuration and add this variable to it, so we can simply change the configuration file without editing the package.

But this time we will use parameters. I added a parameter called ParmPromptValue and assigned “I’m Parameter” as the value. Parameters are of two types: Package and Project. Package parameters can be used within the package. Project parameters can be used by all the packages in a project.

I created a package parameter.

ssis package parameters

Next, we’ve to pass the value of this parameter to the variable we created earlier. We will use expressions to do that. We know we can use other variables in the expressions builder. In addition to that, we can use parameters. I dragged the package parameter @[$Package::ParmPromptValue] to the expression window.

image

What should we see when I execute the package? Should it be [I’m Variable] or should it be [I’m Parameter]?

Since we used an expression to the variable, the value of the parameter overwrites the value of the variable.

image

We’ve so far executed the package from Visual Studio. In the below image, I deployed the package to SSIS catalog and assigned a different value to the parameter. More about deployment in the next post.

image

This is what I see when I run package from SSIS Catalog (Server).

image

Why in the world would you want to change the value like in this example, you might ask. I agree. This is a fictitious example, but think of connection strings, database names, user name/passwords that you can’t live without changing when moving packages through environments.

I’ve provided an introduction to parameters in this post. Be sure to read the following for more information. Parameters in Denali by Jamie Thomson and this from TechNet Wiki.

~Sam.

Follow Sam on Twitter – @SamuelVanga



Republished from Sam Vanga's Blog [16 clicks].  Read the original version here [1 clicks].

Samuel Vanga
539 · 0% · 68
3
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"Change Package Properties Using Parameters–SSIS 2012" rated 5 out of 5 by 3 readers
Change Package Properties Using Parameters–SSIS 2012 , 5.0 out of 5 based on 3 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]