Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use relative paths for SSIS packages dtsConfig files?

Tags:

I am trying to make our SQL Server Integration Services packages as portable as possible and the one thing that is preventing that is that the path to the config is always an absolute path, which makes testing and deployment a headache. Are there any suggestions for making this more manageble?

Another issue is when another developer gets the package out of source control the path is specific to the developers machine.

like image 562
John Lemp Avatar asked Oct 24 '08 13:10

John Lemp


People also ask

What is Dtsconfig file?

A DTSCONFIG file is an XML configuration file used to apply property values to SQL Server Integration Services (SSIS) packages. The file contains one or more package configurations that consist of metadata such as the server name, database names, and other connection properties to configure SSIS packages.

How many types of package configurations are available in SSIS?

Solution. SSIS provides several options for handling package configuration values such as environment variables, XML files, registry settings, and a table in a SQL Server database.

Where is the SSIS config file?

\Configs\MyConfig. dtsConfig . SSIS will try to access the Config directory from the path where your SSIS package is executed. This can be annoying to deploy, as in debug mode, SSIS executes from the bin directory of your project.

What is relative route?

A relative path refers to a location that is relative to a current directory. Relative paths make use of two special symbols, a dot (.) and a double-dot (..), which translate into the current directory and the parent directory. Double dots are used for moving up in the hierarchy.


1 Answers

If you are trying to execute your packages using Visual Studio then the configuration file path will be hardcoded in there. So if you move your project around you'll need to change the path in the package settings. To avoid this you could use the Environment variable option to store the configuration file path. Then you'll only need to change that.

For testing and deployment however you should probably use the dtexec utility to execute your packages. Make some batch files for that. Preferably one for each different environment. Here the configuration file path can be relative.

dtexec /File Package.dtsx /Conf configuration.dtsConfig 

This is if you're packages are on file system. You can also store them in SQL Server. You can also store your configuration in SQL Server which may provide flexibility.

like image 148
Malik Daud Ahmad Khokhar Avatar answered Sep 28 '22 08:09

Malik Daud Ahmad Khokhar