Configurations in SSIS are mainly used to make the package independent of the environment dependent objects such as connection strings ,location of files etc.. When we deploy our package to different server with different configurations we can easily apply the environment dependent objects through configurations .
I will implement direct configurations initially than i will extend to indirect configurations.
I'm using the same package of my previous demo,a simple package of for each loop for a collection of excel files,which loads the files dynamically to a database table.So the connection string for excel source is implemented dynamically by using variables with expression as i explained in my previous post,and the destination is connection string pointing to a table in my local database SSIS Demo
I will create a configuration file for these two
In order to create configuration you can either go to SSIS menu or right click on your design surface and add configurations
I have selected configuration type as xml configuration file ,and given a location for it.remember configurations can be implemented using many ways with xml files or sqlserver or environment variables in this demo i will be using combination of xml files and environment variables.In the next step we will selecting the environment dependent variables
This example simply selects connection string for our destination database and variable value. By Capturing these we can make changes in our destination server configuration with relevant values which are local to that environment .In next step give a name and finish.
Save the package and manually copy the package to the other server.
Bring DTEXECUI by searching for programme file for DTEXECUI
Double click DTExecUI
Give the connection details of the package location and than add configuration file as shown above.The Configuration file should be edited as per your environment.
This is a direct configuration,as we need to provide the hard coded location of the configuration file which is not a flexible approach.In order to avoid this we will create an environment variable pointing to the location of configuration file
Environment variables can be set by right clicking the computer and advance system settings and environment variables .
and finally configure the environment variable. and give this environment variable name while executing the package on the destination server with the environment variable set.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.