The SSIS System variables stores and helps to provide the information about the running Package and the log information. This SSIS Integration Services article shows how to use the System variables with an example.
The following list shows the list of available system variables in SSIS.
System Variable | Data Type | Description |
---|---|---|
CancleEvent | Int32 | The task stops running. |
ContainerStartTime | DataTime | The Container Start Time. |
CreationDate | DataTime | The Package created date. |
CreatorComputerName | String | The name of the computer on which this package was created. |
CreatorName | String | The username who created this package. |
ExecutionInstanceGUID | String | A Unique Execution Instance ID of a Package. |
FailedConfigurations | String | The name of the package Failed configurations. |
IgnoreConfigurationsOnLoad | Boolean | To ignore the package configurations while loading the package or not. |
InteractiveMode | Boolean | To run the Package in Interactive Mode or not. |
LocaleId | Int32 | The Locale that the package uses. |
MachineName | String | Computer name which the package runs. |
OfflineMode | Boolean | Whether the package is in Offline Mode. |
PackageID | String | A unique package ID. |
PackageName | String | Name of a Package. |
StartTime | DateTime | Package start Time. |
ServerExecutionID | Int64 | Package Execution ID on Integration Services Server. |
UserName | String | The User who started the package. |
VersionBuild | Int32 | Package Version. |
VersionComment | String | Package Version comments. |
VersionGUID | String | A unique ID of a version. |
VersionMajor | Int32 | Package Major Version. |
VersionMinor | Int32 | Package Minor Version. |
SSIS System Variables Example
Drag and drop the SSIS Data Flow Task into the control flow region.
Double-click to open the Data Flow Region. Then, add the flat file source and double-click on it to open the Source Editor.
Click the New button to open the Flat File Connection Manager Editor window. Next, click the Browse button to choose the Employee file.
If the file’s first row has header names, checkmark the Column Names in the first data row option.
Use the advanced section to change the Data type. Here, the column data type must match the destination table; otherwise, it throws an error. After you finish, click OK to close the window.
Drag the Derived Column Transformation and connect it to Flat File Source. Double-click on it to open the editor.
We are using some system variables in this SSIS example, but you can try the remaining ones.
Next, drag the OLE DB Destination and double-click on it to open the Editor. Then, we have chosen the existing connection. Next, click the New button to create a new table.
Go to the Mappings tab to check the input and available destination column mapping.
Run the SSIS System Variables package.
You can see the machine Name, Start Time, etc., within the SQL Management Studio.