Create dynamic packages that accept parameters

Created by: Kristinn Magnusson

In this article, you will read about how to create dynamic packages that accept parameters. Package Parameters are a way to execute packages with different arguments depending on external factors. For example, you could create a package that takes as an argument a productID and then create an SSIS process to execute the package for each product.

Designing Packages With Parameters

Package parameters are added to packages in the following format:

{@parametername[default:value][datatype:value]}

You can use each parameter multiple times, but you can only define it once.

The default value is always used when the user executes the package without specifying the parameter value. The exMon Portal uses the datatype value to give the user proper input control. For example, a date and time picker.

You only have to define a parameter once, in Working Directory or Command and you will have access to the parameter in both of the same UAT.

Parameter data types

Datatypes affect only the input control for Portal. They affect text alignment as well as which control is used.

Note: Data types are not case sensitive

Available data types are:

Left alignment

  • String
  • Varchar
  • Char
  • No datatype definition

Right alignment

  • Int
  • Int32
  • Long
  • Int64
  • Short
  • Int16
  • Decimal
  • Double

Datepicker

  • Date
  • Datetime

Executing with package parameters

When a user executes a package that has defined a parameter with a default value, the package will use that default value in all executions where the user does not explicitly define a value for the said parameter.

You can for example execute the package above in two ways:

epcmd --startpkg 1 --uat DEV --@countandsize 32 --@path c:\
epcmd --startpkg 1 --uat DEV

When executing a package that defines parameters from exMon Portal you are prompted to fill in the required parameters. If a parameter has a default value defined, that parameter’s input box will be filled with it by default.

Kristinn is the author of this solution article.