Environment variable in SSIS not being recognized

If you are using environment variables in SSIS when using package configuration, chances are you will run into a situation where you add or change the value of an environment variable, and SSIS does not recognize it.  There is a misconception that in order for the packages to start recognizing it, the machine needs to be restarted.  The reality  is that just the process which is running the SSIS packages needs a restart. Typically this is the SQL agent if you have a job that is executing the package, or you will need to restart the SSIS service if you are running the package directly.  In a development environment, BIDS would need a restart.

In my SSIS packages I typically use package configurations, having an environment variable called SSIS_CONFIG_DB that defines the connection string to my SSISConfig database.  In this database is a table called SSISConnectionConfig, which contains the connection info for all the connections used in the package.  So, if I have SSIS_CONFIG_DB pointing to development and I’m in Visual Studio testing the package, if I then change SSIS_CONFIG_DB to point to production, I must exit Visual Studio and start it back up again for Visual Studio to start using production.

About James Serra

James is a big data and data warehousing solution architect at Microsoft. Previously he was an independent consultant working as a Data Warehouse/Business Intelligence architect and developer. He is a prior SQL Server MVP with over 25 years of IT experience.
This entry was posted in SQLServerPedia Syndication, SSIS. Bookmark the permalink.

3 Responses to Environment variable in SSIS not being recognized

  1. We have tried multiple approaches overhere:

    – configuration value in environment variable
    – configuration value in config file
    – configuration value in config file (with environment variable pointing to config file)

    And in the end we just used variables (and override them via the /SET parameters for DtExec)

  2. vipul sachan says:

    Step by step configuration of Enviornment variables in SSIS package,
    Check the below link

  3. Jon Lunn says:

    I’ve run into the same issue, having changed a Environmental Variable on the Server to pick up a new data connection to UAT database, but when running the job via a SQL Server agent job, the SSIS package would not pick up the connection change. I restarted the SSIS service but still no affect, restarted the SQL Agent Job service, and the package picked up the change. Using BIDS or SSDT or Visual Studio it picked up the change OK