Environment Settings in SSIS Projects

The test package works, then production reads the test file share. Environment settings in SSIS projects prevent that mix-up when project parameters and SSISDB references are wired correctly. The same package should move without editing its internals.

An electric kettle on a counter beside three different plug adapters, one of them fitted into the wall socket.

Separate Code From Environment Values in SSIS Projects

Connection strings, file roots, batch limits, and feature switches vary by environment. Package logic should not be cloned for test and production just to change these values. Define parameters with clear names and types, then supply environment-specific values at execution. Keep secrets out of project source and deployment scripts.

I look for literal server names and file paths before a release. A package that contains a production password in a connection manager is a deployment problem, even when its data flow is perfect. What must change between test and production? Write that list first.

Choose Parameters for SSIS Projects and Packages

A project parameter is available across packages in the project. A package parameter is scoped to one package. Use the broader scope only for values genuinely shared. Mark required values appropriately and avoid a harmless-looking design default that can run against the wrong endpoint if a mapping is absent.

I use names that identify purpose, not environment. SourceConnection is clearer than ProdConnection inside a reusable package. The environment supplies whether it points to a test or production server.

Create SSISDB Environments

SSISDB environments hold named variables. An environment reference connects a deployed project to an environment, and parameter mappings select variables. An execution chooses the reference. The deployment can remain identical across environments while the selected reference changes.

I verify the reference on the execution itself. A project can contain a correct production environment and still run with the wrong reference. Configuration is a path, not a bag of variables.

Inspect Environment References

The SSISDB catalog exposes project-to-environment references. Query it before a deployment or after a surprising run. An absolute reference can name a different folder; a relative reference resolves within the project folder. Confirm both location and name rather than matching only a friendly label.

This query is read-only. Run it in the instance hosting SSISDB with permissions to view the projects.

SELECT p.name AS project_name,
       f.name AS project_folder,
       r.reference_id,
       r.reference_type,
       r.environment_folder_name,
       r.environment_name
FROM SSISDB.catalog.environment_references AS r
JOIN SSISDB.catalog.projects AS p
  ON p.project_id = r.project_id
JOIN SSISDB.catalog.folders AS f
  ON f.folder_id = p.folder_id
ORDER BY f.name, p.name, r.environment_name;
One artifact, values chosen at run time: a diagram about the SSIS projects

Map Parameters Explicitly

A project parameter can reference an environment variable, or it can use a literal server value. For a required parameter, deployment and execution rules affect fallback behavior. Test missing and misspelled variables so the package fails safely. Do not assume the design-time value will always be ignored.

I prefer a required connection value and a preflight check that prints nonsecret endpoint details. The package should stop before moving rows if its source and destination are not the intended pair. A silent fallback is worse than an early failure.

Review Parameter Metadata

catalog.object_parameters lists deployed parameter names, value types, sensitivity, and how values are assigned. Sensitive values should remain masked in normal views. Use the catalog to compare expected mappings across SSIS projects, not to export secrets. Keep a deployment manifest with names and required types.

The query below lists metadata only. Adapt the folder and project filter to the release. I inspect it after deployment because the project that ran matters more than the project file on a laptop.

SELECT object_name, parameter_name,
       parameter_data_type,
       required, sensitive,
       value_type
FROM SSISDB.catalog.object_parameters
WHERE project_id IN
    (SELECT project_id FROM SSISDB.catalog.projects)
ORDER BY object_name, parameter_name;

Keep Secrets Out of Logs

SSISDB supports sensitive environment variables, but a package can still print a connection string or token in an error message. Review logging and custom messages. Use service identities and least-privilege access. Rotate credentials through the approved process and test that the package fails clearly when a credential expires.

I log the server and database name when safe, never the password. Operators need to know where a load ran without receiving a copy of its secret. That boundary belongs in package design and incident practice.

Deploy SSIS Projects as the Same Artifact

Build one project artifact and promote it through test and production with environment references. Record version, reference ID, execution ID, and validation results. Do not open the package and change a hard-coded path between stages. That creates two different artifacts and makes a successful test weak evidence for production.

I run a small preflight in each environment to check connectivity, permissions, and target schema. Then I compare row counts and reject behavior with the expected source. Deployment success is not data-load success.

Test Failure and Restart

Temporarily remove a test mapping or point to an unavailable test endpoint and confirm that the package stops before writing. Restore the correct reference and rerun. Check that log entries identify the environment and that restart does not duplicate rows. A reusable package needs safe failure behavior as much as clean configuration.

SSIS projects benefit from environments when the same package can run with different approved values. Keep the mapping visible and test the resolved endpoint. One package is a strength only when it cannot quietly work in the wrong place.

Deployment should set the environment reference deliberately. A package deployed unchanged to test and production can still read the wrong values if the reference points to the wrong environment. Query the catalog after deployment and record which project parameter maps to which environment variable.

I test a safe failure, such as an unavailable source, under the production-like reference before release. The error should name the failing connection without exposing its secret. Keep sensitive values in the supported protected setting and restrict who can read or change them. A parameter called ProductionServer does not prove it contains the production server. Verify the effective value through controlled catalog views and a connection test. The package artifact should stay identical while settings change by environment.

Check that a missing variable stops deployment or execution clearly. A package should not fall back to a development connection when a production reference is absent. I prefer a failed startup to a successful load into the wrong database.

Include the environment name and reference ID in the deployment checklist. A screenshot of variable names alone does not prove the package will resolve them at execution time. Run the package with the intended reference and inspect the effective settings.

Related reading on this blog: Huge Size of SSISDB: Catalog Database SSISDB Cleanup Script and SSIS Parameters in Parent-Child ETL Architectures: Notes from the Field #040.

Around every release: a checklist on the SSIS projects

An SSIS environment is not a renamed package, it is a controlled set of values for one artifact.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

ETL, SQL Server, SQL Server Configuration, SQL Server Security, SSIS
Previous Post
AsGml: Export a Shape as Namespaced XML
Next Post
SQL SERVER – How to Enable Index – How to Disable Index – Incorrect syntax near ‘ENABLE’

Related Posts

2 Comments. Leave new

  • Hi Pinal,
    In my usage of SSIS usage, I have used and found the XML configuration option to be really effective and neat, second option would be the SQL Server Configuration option.

    Reply
  • Pinal:
    Have you ever had success in abstracting out the usernames and passwords from SSIS packages so that the packages can be developed in a development environment, and then moved into a production environment without changing the package? Have you ever HEARD of this being done?

    it seems the usernames and passwords are included in the package (bad design microsoft), so that the data center is left with two options: (1) edit the package after it’s been QA’d (violates standard QA process of “what we tested goes into production”) or (2) have the same usernames and passwords for both development and production (VERY BAD DESIGN).

    until this can be resolved, we’re using compiled languages for our imports and exports.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.