SSIS Create variables and parameters
Both variables and parameters are similar in their usage, but with one major difference—parameter values cannot be changed when the package is running (at runtime). Parameter values are fixed for the duration of the package execution.
System variables and user variables
Some commonly used System Variables are:
- MachineName Name of the server where this package is currently running
- PackageName Name of the current package
- TaskName Name of the Task currently running within the PackageName
- UserName User that started the package
- StartTime DateTime the package was started
- VersionBuild Version number of package (automatically versioned)
When creating variables, you can specify the following:
- Name of the variable.
- Scope indicates which components in the package the variable is visible to. By default, the scope contains the name of the package, which means that any object within the whole package can view and access this variable. But if the variable is created to be visible to a sequence container, only it is local to the sequence container and only the sequence container and all of the objects within the sequence container can see and access this variable (this is similar to private and local variables in most programming languages). But any object outside of the sequence container would not be able to see or access this local variable.
- Data type is the SSIS datatype.
- Value can be a default value or left empty and populated during runtime, e.g. the current datetime or servername.
- Expression allows the value of the variable to be set by an expression using the SSIS expression language.
Package vs. project parameters
SSIS has two different deployment models:
- Project deployment
- Package deployment
The package deployment model means nothing is shared and that everything is maintained separately within each individual SSIS package—variables, connection manager, etc.
The project deployment model enables you to deploy your SSIS project as a single unit with shared resources, including parameters, and packages. It is deployed to either file, or to this SSISDB database catalog within SQL Server.
Comments
Post a Comment