How to change the connections in SSIS package after deployment? - sql-server

Just started to work on a SSIS ETL package at work and I am sort of stuck thinking how to solve this problem and how others solved it. Since I am fair new to SSIS, I must ask the experts here. So I am creating a SSIS ETL package which I create source and destination connection (mostly relational databases) in a development environment, which means the source and destination connections are to development databases. Everything works out fine. The problem is when I complete the SSIS package, build it, create the manifest and deployed, then I realize the package will fail, because I have deployed the package in the production environment, which means the source and destination connection are to production databases, in production environment.
So my questions is how do I create a ssis ETL package in the development phase or development environment using development source and destination connections be able to deploy a package into a different environment where the source and destination connection are different?
I am using sql server 2012 with BIDS 2012, Data Tools 2012.

You can make the package connection configurable.
select "SSIS">> Pacakage Configuration >> navigate to connection >> select servername and database name
Click next
Save pacakge configuration to dtsconfig file.
During deployment modify this dtsconfig file and specify.

once you have deployed your package navigate to Integration Services Catalog -> SSISDB -> your SSIS Project.
Once there open up the desired package and under [Connections] tab you can change the connection.
Alternative to this (method 2) is to create Environments; where you can quickly change between dev, qa, prod by checking towards the bottom which environment you wish SSIS to pick up config from.

Related

Is it possible to switch between SSIS data sources when calling a SSIS package using File System in SQL Server Agent?

Having now added a like for like DB to do UAT on to our server I have run into a problem with our SSIS Packages. They are stored as files and as such we use File System in SQL Server Agent to run them on a schedule. I now need to run these packages on both databases (different data sources).
I have checked over documentation and forums and when paramterizing over environments every time it relates to the deployment of packages to the catalog. Which I think is because with files they are saved with package data sources not project data sources.
This left me wondering...
Is it possible to switch data sources when calling a package using File System in SQL Server Agent?
Unfortunately the answer on this is no.
Moving to the SSIS catalog allows you to switch between environments which you can set in SSMS.
This is a great link: https://blog.exsilio.com/all/configuring-environment-variables-ssis-package/
I did get an error when running my agent job after this but this was a need to set the runtime to 32bit.
In SSIS - Right click your solution and head to debugging to find the option.
In SQL Server Agent - Head to Config and advanced where you would set the environment variable in the SSIS step you have created.

SSIS Project Deployment with excel

I created an SSIS project with multiple packages. One of my package has a data flow task using Excel as data source. After deploying the project to SQL SSISDB, I can see the .dtsx files in SSMS. But where should the excel file reside? Should it still be in my local machine. The SQL resides on another server and not my local machine. Where is the deployed packages stored?
Can someone explain these?
Excel file
If the excel connection manager are pointing to a fixed path on your local machine. It will throw an error when executed from different server since the excel file path is not found.
You have to use dynamic excel connections to fix this issue, or to use an excel file on a shared network location (UNC path).
Package deployment
After deployment, the packages are stored within SSISDB database:
Deploying Packages to SQL Server Integration Services Catalog (SSISDB)
Ways to use and execute SQL Server Integration Services packages
SSISDB for SQL Server Integration Services

GIT - SSIS DB Production Server not in sync (Deployment without Commit)

I've started a new job as a BI Dev working with SQL Server, and I've run across a major issue that was left behind by old lazy devs.
Without any controls or deployment models implemented, there's been a free for all on deployment to the production server. As a result there is a discrepancy between the SSIS packages that are on the SSIS Catalog on the production server and what is in source control.
Does anyone know a method that I can use to grab all of the SSIS projects deployed to the server and sync them into git?

Deploying a SSIS 2016 packages (Project Deployment Model) to the file system

Working on a project to migrate SSIS 2008 projects to 2016 deployed to a File Server. Currently have the packages on the file server and prefer to keep it that way. I'm aware that the Project Deployment Model has been introduced since 2012.
Questions:
Can I change the migrated projects to Project Deployment Model and still deploy to the File System? Is changing to a Project Deployment Model a best practice?
Researching online, I can only find tutorials on how to deploy to SSISDB(Catalogue). Is the deployment to a File System still the same as previous versions ie. Build project > SSIS creates manfest file in project directory > open the manifest file to deploy?
Well, it is possible with certain limitations.
First, let's state that "deploying to File System" usually means that you store your package on a file system folder, and run it with dtexec. In that sense, deploy SSIS Project to File System is certainly possible, you can run any package from project file. For more details and examples - see MS Docs on dtexec.
However, this is not practical. By doing so, you loose a significant part of SSIS functionality introduced in 2012 version. For example, execution reports in SSIS Catalogue, and project environments which allow fine control and management of package parameters, including encryption of sensitive data like passwords. SSIS Catalogue keeps versions of deployed packages, so you can roll back to previous version easily.
Besides, SSIS Catalogue is fully supported in SSMS; on running package from project file - you are on your own to supply parameters; connection strings are usually passed from environments.
Yes, it's possible but not recommended (and not always possible). Package deployment model exists for backward compatibility. Once you convert your packages to Project Deployment Model you should deploy only to the SSISDB catalog on an instance of SQL Server.
Project Deployment Model contains packages, parameters, Connection managers and more very cool features introduced in 2012. This is the best option to work with SSIS these days.
https://learn.microsoft.com/en-us/sql/integration-services/packages/deploy-integration-services-ssis-projects-and-packages

How to script an already deployed SSIS project from SSISDB - SqlServer 2012

I want to know if, for an already deployed SSIS project, from SSISDB-Sql Server 2012, I can script the hole package, with all its parameters, connection managers, references, everything?
I have an already deployed SSIS project but I must deploy it using scripts to some other database and I would like to script all project parameters.
Regards,
You can export whole SSIS project from SSISDB as an .ispac file from SQL Server Management Studio; just select project and Export... from context menu. However, this file will contain only project with its parameters, connection managers and packages; you can deploy it on another server without references and environments.
You cannot export referencies and environments from SSISDB with SSMS. There is an excellent article with script sample. Script generates a set of t-sql commands recreating environment and its references with project.
Combining these two approaches you will be done.

Resources