Showing posts with label packages. Show all posts
Showing posts with label packages. Show all posts

Thursday, March 29, 2012

Configure connection strings for deployment to different servers

Hi,

We currently have a test and development environment for our data warehouse which is using SSIS packages to build (SSIS packages call stored procedures). We have multiple connections accross the different packages. The problem that we are having is when we deploy the packages to the development environment, the connection strings in the packages are still pointing to the live server! Hence, when we run these packages in the test environment, they actually execute the stored procedures in our live server.

I have tried to use package configurations and the deployment utility to assist us in this regard but have still come up with a few problems:

- When running the deployment utility, I still have to go and manually type in the data source the connection string must use - Is there maybe a way to use some sort of a variable that will automatically set this dependant on the name of the server that you are deploying to?

-It seems, even when I deploy to my live server, if I change the data source to point to my live server, it goes and changes the data source for the packages on my test server to point to the live servesr as well/

Basically, what I would like at the end of the day is to just be able to select the server the packages must be deployed to, and the connesction strings must be set automatically to either the test or live server dependong on which one I deploy to. Anyone know if this is possible?

Thanks in advance

Hi, it almost sounds like you have 1 configuration file...that all pacakges look at regardless what server they were deployed to. Thats the only way I could explain why making a change for the live server deployment affects packages running in test environment. If you look at the where things are deployed in each environment, do you see a config file in each location and does it contain the appropriate information? I think you can accoplish the dynamic connection string. Are you using property expressions to dynamically build/set your connections. There is a system variable available in SSIS named 'MachineName'. I must admit I have not played with it in a while and you need to be aware load order of 'stuff' is important. So, as a package spins up, it loads configurations and then applies property expressions as things are executed. So, I cannot recall if the system variable is set in time a property expression to use it. Another route is use an environment variable configuration. so the package loads and pulls in the servername frrom an environment variable on the machine and then that can be use in a property expression.

Hope that helps

|||

Yep, system variables are populated first and then expressions evaluated.

K

|||Will give it a try. Thanks for your help.

Configure connection strings for deployment to different servers

Hi,

We currently have a test and development environment for our data warehouse which is using SSIS packages to build (SSIS packages call stored procedures). We have multiple connections accross the different packages. The problem that we are having is when we deploy the packages to the development environment, the connection strings in the packages are still pointing to the live server! Hence, when we run these packages in the test environment, they actually execute the stored procedures in our live server.

I have tried to use package configurations and the deployment utility to assist us in this regard but have still come up with a few problems:

- When running the deployment utility, I still have to go and manually type in the data source the connection string must use - Is there maybe a way to use some sort of a variable that will automatically set this dependant on the name of the server that you are deploying to?

-It seems, even when I deploy to my live server, if I change the data source to point to my live server, it goes and changes the data source for the packages on my test server to point to the live servesr as well/

Basically, what I would like at the end of the day is to just be able to select the server the packages must be deployed to, and the connesction strings must be set automatically to either the test or live server dependong on which one I deploy to. Anyone know if this is possible?

Thanks in advance

Hi, it almost sounds like you have 1 configuration file...that all pacakges look at regardless what server they were deployed to. Thats the only way I could explain why making a change for the live server deployment affects packages running in test environment. If you look at the where things are deployed in each environment, do you see a config file in each location and does it contain the appropriate information? I think you can accoplish the dynamic connection string. Are you using property expressions to dynamically build/set your connections. There is a system variable available in SSIS named 'MachineName'. I must admit I have not played with it in a while and you need to be aware load order of 'stuff' is important. So, as a package spins up, it loads configurations and then applies property expressions as things are executed. So, I cannot recall if the system variable is set in time a property expression to use it. Another route is use an environment variable configuration. so the package loads and pulls in the servername frrom an environment variable on the machine and then that can be use in a property expression.

Hope that helps

|||

Yep, system variables are populated first and then expressions evaluated.

K

|||Will give it a try. Thanks for your help.

Configurations and Child Packages

Hello,

I was hoping someone might be able to clarify how configuartions work with child packages. My process has 3 levels of packages. The main packages called two child packages each of which calls more child packages.

I'm using Configurations to pass variables from parent packages to child packages. But each level of packages contains Data Flow Source/Destination connections. I was planning on having only 1 XML Configuration file in the main package that would allow the data connections for the main package to be configured for the target enviornment. When the job is scheduled I will be able to point a configuration file for use with the main packages. But will that configuration file be applied to all child packages that will run? All of the Connections Managers have the same name so I'd like to make the change in one file.

If not, am I forced to define a parent/child variable to pass the Connection String from the parent to each of the child packages? Use an expression to set the Connection String dynamically? This seems like a lot of extra work, so I'd really like to see if there is a way to do it with an XML configuration file. Even if I have to definte the same config file for each of my 20+ packages.

Thanks

-Dan

Dan,

It is eminently possible for multiple packages to use a single configuration file - I use this technique all the time. What difficulties are you having in doing this?

Tip: Indirect configuratoins can really help because once you have set them up, "picking" them for use in other packages is dead dead simple.

-Jamie

|||

I guess my confusion is just in how it will work. Perhaps I can boil it down to 2 simple questions.

1. Do I specific in every one of my packages, an XML Configuration file and point them all to the configuration file I created containing all of the common Connection Managers? Or will a child package automatically inherit the configuration of its parent package?

2. When it comes to deployment, I will schedule a job in SQL Server and I will select the XML configuartion files to use for the main package. Will the child packages know to use the same configuration file as well?

I haven't been able to run this package yet as I'm doing my final cleanup for configuration and deployment. I'm trying to get a handle on how this is going to work with the child packages to know how to finish this process. I've used configurations before but only in single package solutions.

|||

infrandom wrote:

I guess my confusion is just in how it will work. Perhaps I can boil it down to 2 simple questions.

1. Do I specific in every one of my packages, an XML Configuration file and point them all to the configuration file I created containing all of the common Connection Managers? Or will a child package automatically inherit the configuration of its parent package?

Yes to the first part of that question. No to the second part.

Which is a shame actually. I know that the subject of scoping connection managers to containers was discussed but not implemented in SSIS2005 due to time constraints. It would certainly be nice to be able to do this in order that connection managers behave just like variables and connection managers in a package can be "seen" by descendant packages. If you want to raise a ticket at Microsoft Connect requesting this functionality for a future version then I will definately vote for it.

infrandom wrote:

2. When it comes to deployment, I will schedule a job in SQL Server and I will select the XML configuartion files to use for the main package. Will the child packages know to use the same configuration file as well?

I think that is kinda answered by my answers to the previous question.

infrandom wrote:

I haven't been able to run this package yet as I'm doing my final cleanup for configuration and deployment. I'm trying to get a handle on how this is going to work with the child packages to know how to finish this process. I've used configurations before but only in single package solutions.

Sounds like you're not far away

|||

Thanks for the clarification Jamie. I was was pretty sure that I would have to add it into each of the packages. Here I go, another round through them all.

Tuesday, March 27, 2012

Configuration Packages are still in Beta

I would just like to give my feedback on the configuration packages implementation in SSIS:

THIS STUFF SHOULD BE A NO BRAINER AS IT IS A COMMON REQUIREMENT ON ETL PROJECTS.

I have trolled through these forums and found that I am not alone on this issue. Note for SSIS Team: Please bring out a HOWTO on this subject that details all the little work arounds because intuitively used it does not work.

Consider this:

I develop in BIDS on my client and everything runs. I create a config package and I choose only the Name and ConnectionString Properties for each Connection Manager. (Thanks to Jamie for that tip)

I build the app and a deployment utility is created. I navigate to the deployment directory, and deploy. I point to a mapped share on the production server, change all the properties for production and continue until finished.

On the production server I run a script containing:

dtexec /FILE D:\SSIS\Source\code\Source.dtsx >> D:\SSIS\Source\logs\Source.log

I get an error: Cannot find the configuration file: source.dtsConfig

I tried putting the following in the script:

dtexec /FILE D:\SSIS\Source\code\Source.dtsx /CONFIGFILE D:\SSIS\Source\code\source.dtsconfig >> D:\SSIS\Source\logs\Source.log

Still: Cannot find the configuration file: source.dtsConfig

I have to MANUALLY edit the dtsx file to put the path in from the the name of the config file and THEN it works.

Thinking that it might not like a mapped share from desktop to deploy to, I copIED the contents of the depLoyMENT directory on my desktop to a folder on the production server and deploy from there. It should pick up the proper path from there. NOT!!!!

So it was back to editing the dtsx file.

So there you have it. I await all comments with great interest.

I hope this is all fixed in SP2, Because I don't want to waste anymore time on what should be a simple task.

Michael Morrissey.
ETL and BI Developer.

if i'm not mistaken, your issue cries out for an indirect configurations solution: http://dotnetjunkies.com/WebLog/appeng/archive/2006/05/30/indirectconfigpackagessis.aspx|||

...one year later

I run on a similar problem - I created xml configuration file where I put the destination server's connection string, planning to use another sql server configuration table where it would be convinient to change some package properties before running.

And as I understud, with the /Conf tag I could change the path of the xml conf file, but I could not, I dont know if I am wrong somewere but the /Conf tag for me just did not works.

Later I realized that the deploying utility changes the path in the package itself, so maybe that tag is not needed (better, less characters Smile)

So I overcomed that question and resumed with that combination, it is just great for me like that.

I tryed with environment variable and with registry, but because of less privilegies on production I just could not make them work.

Conclusion: there are a lot of catches about SSIS, but it is interesting, it's foundations are good.

|||

Berzat,

Package configurations are working, and work well for most scenarios.

If you searchyou will find tons of working examples. Here is mine http://rafael-salas.blogspot.com/2007/01/ssis-package-configurations-using-sql.html

Notice that it uses an env. Variable; but you could use an XML file instead and get the same functionality.

|||

Thanks Rafael, indirect configuration is something else.

The /conf option for direct configuration does not working as it is pointed in the ssis documentation and nobody wants to confirm that or to prove the oposite...

|||

Bertzat,

You could prove it then; You just have to provide a 'repro'; a series of steps that everyone can follow and get the same results. Then post it in the connect site; the SQL server team will appreciate it.

|||

:-) I don't know if you are kidding me or not, but there are tens of articles where people are wasting time trying to work out their solutions with the /conf option (like Michael Morrissey on the top of this article).

Isn't that enough?!

|||

Berzat wrote:

:-) I don't know if you are kidding me or not, but there are tens of articles where people are wasting time trying to work out their solutions with the /conf option (like Michael Morrissey on the top of this article).

Isn't that enough?!

I believe Michael was using relative file paths to point to his configuration file. Absolute paths are a requirement inside SSIS. And then when deploying, you need to ensure that the file path exists and the config file resides there. So no, it's not enough. If you are having a different issue, then please post your steps necessary to recreate your issue.

|||Phil, I agree with your points, but I did want to mention that absolute paths are not required - though they are a good practice and head off a lot of troubleshooting issues. If you are extremely careful, you can use relative paths. However, I really don't recommend it as general practice.

Configuration Packages are still in Beta

I would just like to give my feedback on the configuration packages implementation in SSIS:

THIS STUFF SHOULD BE A NO BRAINER AS IT IS A COMMON REQUIREMENT ON ETL PROJECTS.

I have trolled through these forums and found that I am not alone on this issue. Note for SSIS Team: Please bring out a HOWTO on this subject that details all the little work arounds because intuitively used it does not work.

Consider this:

I develop in BIDS on my client and everything runs. I create a config package and I choose only the Name and ConnectionString Properties for each Connection Manager. (Thanks to Jamie for that tip)

I build the app and a deployment utility is created. I navigate to the deployment directory, and deploy. I point to a mapped share on the production server, change all the properties for production and continue until finished.

On the production server I run a script containing:

dtexec /FILE D:\SSIS\Source\code\Source.dtsx >> D:\SSIS\Source\logs\Source.log

I get an error: Cannot find the configuration file: source.dtsConfig

I tried putting the following in the script:

dtexec /FILE D:\SSIS\Source\code\Source.dtsx /CONFIGFILE D:\SSIS\Source\code\source.dtsconfig >> D:\SSIS\Source\logs\Source.log

Still: Cannot find the configuration file: source.dtsConfig

I have to MANUALLY edit the dtsx file to put the path in from the the name of the config file and THEN it works.

Thinking that it might not like a mapped share from desktop to deploy to, I copIED the contents of the depLoyMENT directory on my desktop to a folder on the production server and deploy from there. It should pick up the proper path from there. NOT!!!!

So it was back to editing the dtsx file.

So there you have it. I await all comments with great interest.

I hope this is all fixed in SP2, Because I don't want to waste anymore time on what should be a simple task.

Michael Morrissey.
ETL and BI Developer.

if i'm not mistaken, your issue cries out for an indirect configurations solution: http://dotnetjunkies.com/WebLog/appeng/archive/2006/05/30/indirectconfigpackagessis.aspx|||

...one year later

I run on a similar problem - I created xml configuration file where I put the destination server's connection string, planning to use another sql server configuration table where it would be convinient to change some package properties before running.

And as I understud, with the /Conf tag I could change the path of the xml conf file, but I could not, I dont know if I am wrong somewere but the /Conf tag for me just did not works.

Later I realized that the deploying utility changes the path in the package itself, so maybe that tag is not needed (better, less characters Smile)

So I overcomed that question and resumed with that combination, it is just great for me like that.

I tryed with environment variable and with registry, but because of less privilegies on production I just could not make them work.

Conclusion: there are a lot of catches about SSIS, but it is interesting, it's foundations are good.

|||

Berzat,

Package configurations are working, and work well for most scenarios.

If you searchyou will find tons of working examples. Here is mine http://rafael-salas.blogspot.com/2007/01/ssis-package-configurations-using-sql.html

Notice that it uses an env. Variable; but you could use an XML file instead and get the same functionality.

|||

Thanks Rafael, indirect configuration is something else.

The /conf option for direct configuration does not working as it is pointed in the ssis documentation and nobody wants to confirm that or to prove the oposite...

|||

Bertzat,

You could prove it then; You just have to provide a 'repro'; a series of steps that everyone can follow and get the same results. Then post it in the connect site; the SQL server team will appreciate it.

|||

:-) I don't know if you are kidding me or not, but there are tens of articles where people are wasting time trying to work out their solutions with the /conf option (like Michael Morrissey on the top of this article).

Isn't that enough?!

|||

Berzat wrote:

:-) I don't know if you are kidding me or not, but there are tens of articles where people are wasting time trying to work out their solutions with the /conf option (like Michael Morrissey on the top of this article).

Isn't that enough?!

I believe Michael was using relative file paths to point to his configuration file. Absolute paths are a requirement inside SSIS. And then when deploying, you need to ensure that the file path exists and the config file resides there. So no, it's not enough. If you are having a different issue, then please post your steps necessary to recreate your issue.

|||Phil, I agree with your points, but I did want to mention that absolute paths are not required - though they are a good practice and head off a lot of troubleshooting issues. If you are extremely careful, you can use relative paths. However, I really don't recommend it as general practice.

sqlsql

Configuration Packages are still in Beta

I would just like to give my feedback on the configuration packages implementation in SSIS:

THIS STUFF SHOULD BE A NO BRAINER AS IT IS A COMMON REQUIREMENT ON ETL PROJECTS.

I have trolled through these forums and found that I am not alone on this issue. Note for SSIS Team: Please bring out a HOWTO on this subject that details all the little work arounds because intuitively used it does not work.

Consider this:

I develop in BIDS on my client and everything runs. I create a config package and I choose only the Name and ConnectionString Properties for each Connection Manager. (Thanks to Jamie for that tip)

I build the app and a deployment utility is created. I navigate to the deployment directory, and deploy. I point to a mapped share on the production server, change all the properties for production and continue until finished.

On the production server I run a script containing:

dtexec /FILE D:\SSIS\Source\code\Source.dtsx >> D:\SSIS\Source\logs\Source.log

I get an error: Cannot find the configuration file: source.dtsConfig

I tried putting the following in the script:

dtexec /FILE D:\SSIS\Source\code\Source.dtsx /CONFIGFILE D:\SSIS\Source\code\source.dtsconfig >> D:\SSIS\Source\logs\Source.log

Still: Cannot find the configuration file: source.dtsConfig

I have to MANUALLY edit the dtsx file to put the path in from the the name of the config file and THEN it works.

Thinking that it might not like a mapped share from desktop to deploy to, I copIED the contents of the depLoyMENT directory on my desktop to a folder on the production server and deploy from there. It should pick up the proper path from there. NOT!!!!

So it was back to editing the dtsx file.

So there you have it. I await all comments with great interest.

I hope this is all fixed in SP2, Because I don't want to waste anymore time on what should be a simple task.

Michael Morrissey.
ETL and BI Developer.

if i'm not mistaken, your issue cries out for an indirect configurations solution: http://dotnetjunkies.com/WebLog/appeng/archive/2006/05/30/indirectconfigpackagessis.aspx|||

...one year later

I run on a similar problem - I created xml configuration file where I put the destination server's connection string, planning to use another sql server configuration table where it would be convinient to change some package properties before running.

And as I understud, with the /Conf tag I could change the path of the xml conf file, but I could not, I dont know if I am wrong somewere but the /Conf tag for me just did not works.

Later I realized that the deploying utility changes the path in the package itself, so maybe that tag is not needed (better, less characters Smile)

So I overcomed that question and resumed with that combination, it is just great for me like that.

I tryed with environment variable and with registry, but because of less privilegies on production I just could not make them work.

Conclusion: there are a lot of catches about SSIS, but it is interesting, it's foundations are good.

|||

Berzat,

Package configurations are working, and work well for most scenarios.

If you searchyou will find tons of working examples. Here is mine http://rafael-salas.blogspot.com/2007/01/ssis-package-configurations-using-sql.html

Notice that it uses an env. Variable; but you could use an XML file instead and get the same functionality.

|||

Thanks Rafael, indirect configuration is something else.

The /conf option for direct configuration does not working as it is pointed in the ssis documentation and nobody wants to confirm that or to prove the oposite...

|||

Bertzat,

You could prove it then; You just have to provide a 'repro'; a series of steps that everyone can follow and get the same results. Then post it in the connect site; the SQL server team will appreciate it.

|||

:-) I don't know if you are kidding me or not, but there are tens of articles where people are wasting time trying to work out their solutions with the /conf option (like Michael Morrissey on the top of this article).

Isn't that enough?!

|||

Berzat wrote:

:-) I don't know if you are kidding me or not, but there are tens of articles where people are wasting time trying to work out their solutions with the /conf option (like Michael Morrissey on the top of this article).

Isn't that enough?!

I believe Michael was using relative file paths to point to his configuration file. Absolute paths are a requirement inside SSIS. And then when deploying, you need to ensure that the file path exists and the config file resides there. So no, it's not enough. If you are having a different issue, then please post your steps necessary to recreate your issue.

|||Phil, I agree with your points, but I did want to mention that absolute paths are not required - though they are a good practice and head off a lot of troubleshooting issues. If you are extremely careful, you can use relative paths. However, I really don't recommend it as general practice.

Configuration Package doesn′t work

Good morning....
I work with many packages in 3 environments...development, homologation and production.
I had in each enviroment the table WCOT_Config with your configurations for this enviroment. There's a connection called Config wich have a expression
ServerName = System::MachineName to pickup the right server for each enviroment.

My package catches the configuration that is in the machine which the expression of the Config points. This

was functioning perfectly, but now my new packages that i place in the

production server are importing for the development server.

Suddenly the configuration stopped to function, but only for the new packages.

I have to check anything else for the package uses the configuration ?

Sorry my poor english ! heeheh

Thanks to everybody

Hy people,
I found the problem....the configuration was using the wrong connection
Thanks to everybody...

Configuration for Configuration Package? Is this Possible?

Hi Guys,

Here's the current scenario:

I am creating a windows application to manage my ssis packages.

My SSIS packages use package configurations, and by default connect to the "SSIS Configurations" table in sql server.

However, I want it to connect to a view instead of this table, so i create a view "vwSSIS_Configurations" and point the package configuration to use the view in sql server.

The application SHOULD be capable of altering the package configuration's configuration and switch its connection between the default "ssis configurations" table, and the view.

Is this possible? I cannot think of a way which I can have my application switch the package configuration's connection.

Thanks,

kervy

There are a number of ways. I would store the connection string of the connection manager in an XML configuration file.

-Jamie

|||

it's not the connection string of the connection manager, but the connection to the package configuration table,

currently my package configurations are looking in the "SSIS Configurations" table.. but I want my application to let the dtsx switch to another configuration table named "SSIS Configurations2" both have the same schema but different values. is there a "configuration" property for the configuration table connection?

|||

Ah OK. Well I've just looked at the setup screen for SQL Server configs for the first time in my life and seen that you can store the config location in an environment variable. I don't know exactly what it does but have you explored that? BOL should contain details to help you.

-Jamie

Configuration files and variables

Hi ..

I need some information on the package configuration files. i.e how to set the configuration parameters from outside the packages. Pls provide me some detailed information along with examples. I want to make my packages to read paramaters from the configuration files as we have in .NET(web.config)////

Secondly I want to know how to play well with variables.. i.e setting a variable.. reading a variable.. passing a variable in the SSIS package dataflows and datatasks.. respectively. Please provide some infomation and a good exam[ple on it I need

sam_idea wrote:

Hi ..

I need some information on the package configuration files. i.e how to set the configuration parameters from outside the packages. Pls provide me some detailed information along with examples. I want to make my packages to read paramaters from the configuration files as we have in .NET(web.config)////

Have you looked in BOL? There's plenty in there regarding SSIS configurations.

Example here: http://www.sqlis.com/?26

sam_idea wrote:

Secondly I want to know how to play well with variables.. i.e setting a variable.. reading a variable.. passing a variable in the SSIS package dataflows and datatasks.. respectively. Please provide some infomation and a good exam[ple on it I need

The 2 most common methods for setting the value of a variable are using an expression (when the variable has EvaluateAsExpression=TRUE, example here: http://blogs.conchango.com/jamiethomson/archive/2005/03/19/1163.aspx) or a script task. There are various tasks (e.g. Execute SQL Task, XML Task) and components (e.g. Rowcount transform, Recordset destination) that can set variable values also.

There is no concept of "passing variables between tasks". A variable is scoped to a container within the package and is accessible by that container and all its ancestral containers. You can pass values between tasks by storing them in variables (note the subtle difference here)

Here's some examples of how you can use variables:

http://blogs.conchango.com/jamiethomson/archive/2005/07/04/1748.aspx

http://blogs.conchango.com/jamiethomson/archive/2005/04/09/1265.aspx

http://blogs.conchango.com/jamiethomson/archive/2005/06/15/1693.aspx

http://blogs.conchango.com/jamiethomson/archive/2005/05/30/1489.aspx

http://blogs.conchango.com/jamiethomson/archive/2005/02/09/964.aspx

Here's a tip for you. Google is your friend and alot quicker than this forum: http://www.google.co.uk/search?hl=en&q=ssis+configurations&meta=

-Jamie

Configuration Files

Hi,

I’m having some issues associated with the configuration files that I can’t understand:

- Having a project with several packages using the same connections in each one (some packages use all connection and others I just have some of them), why can’t I use only one configuration file for all project. Assuming that I would have to configure all packages at least I would like to use always the same file. On the other way I would need 100’s of configuration files (one per package) to configure always the same connection, just because not all the packages use exactly the same connections.

- Having a configuration file on a machine, the package saves the full path, even if the configuration file lays in the same path them the project. When I change my project to another machine that doesn’t use the same file structure forces me to open every package and change the configuration file location.

Having 100’s of packages and a team of developers, even using the source safe, this makes the task just a little difficult

Thanks,
Vítor Ferreira

Sorry for the different fonts
|||

Vítor Ferreira wrote:

Hi,

I’m having some issues associated with the configuration files that I can’t understand:

- Having a project with several packages using the same connections in each one (some packages use all connection and others I just have some of them), why can’t I use only one configuration file for all project. Assuming that I would have to configure all packages at least I would like to use always the same file. On the other way I would need 100’s of configuration files (one per package) to configure always the same connection, just because not all the packages use exactly the same connections.

It is perfectly possible to do this (i.e. share a .dtsconfig file around multiple packages). I'd like to understand why you think it cannot be done.

Admittedly you do have the problem that if a config file references a property that doesn't exist in the package in which it is being used then you will get an error. I have asked for this behaviour to change in the future and I believe it will be.

In the meantime, I aways recommend that you should rationalise your configuration files - splitting them up so that you don't encounter the problem I just spoke of. On the project I have just completed we used a seperate config file for every single Connection Manager and this worked fantasically well because we could easily share config files between seperate packages - I would always take this approach in the future. In fact, I recommend it in my suggested best practices: http://blogs.conchango.com/jamiethomson/archive/2006/01/05/2554.aspx (number 14).

Vítor Ferreira wrote:

- Having a configuration file on a machine, the package saves the full path, even if the configuration file lays in the same path them the project. When I change my project to another machine that doesn’t use the same file structure forces me to open every package and change the configuration file location.

This is why you should use something else I always recommend - Indirect Configurations: http://blogs.conchango.com/jamiethomson/archive/2005/11/02/2342.aspx

Hope that helps!

-Jamie

|||

Jamie,
It works just like you said, that's why i mentioned that i had packages not always using the same connection, because if they all have the same connections or variables used in the configuration file, I have no error. I already have thought on the approach you have mentioned, one configuration file for connection, and it’s probably the best solution.

Thanks,

Vítor Ferreira

|||

Vítor Ferreira wrote:

Jamie,
It works just like you said, that's why i mentioned that i had packages not always using the same connection, because if they all have the same connections or variables used in the configuration file, I have no error. I already have thought on the approach you have mentioned, one configuration file for connection, and it’s probably the best solution.

Thanks,

Vítor Ferreira

Absolutely!!

Its definately the way forward in this scenario. Also, if you use indirect configs its even easier to edit your package configurations because its simply a matter of selecting an environment variable from a list. It works really well!

-Jamie

|||

I would suggest that the indirect configuration feature be augmented to support configuring the root path of configurations from an environment variable. Then just configure the remaining path portion or filename from the designer.

This would allow a single environment variable for a set of packages and each package would just have the configuration file name that is maintained.

Fred

|||

Jamie,
Correct me if I am wrong, but to use environment variables to configure the configuration files path, I will need to use one environment variable for each configuration file, even if they lay all in the same directory!?

Thanks,
Vítor
|||

Vítor Ferreira wrote:

Jamie,
Correct me if I am wrong, but to use environment variables to configure the configuration files path, I will need to use one environment variable for each configuration file, even if they lay all in the same directory!?

Thanks,
Vítor

Vitor,

Correct. That's the approach we used on my last project and we were really happy with it.

-Jamie

|||I'm trying to setup my indirect configuration path using environment variables. I have an environment variable that contains the location of the configuration file. Once I do that I don't have the option to export any variables to this file anymore. Do I have to configure everything using a direct path, then once I'm finished, set it to the environment variable? This seems awckward...|||

Pirooz Javan wrote:

I'm trying to setup my indirect configuration path using environment variables. I have an environment variable that contains the location of the configuration file. Once I do that I don't have the option to export any variables to this file anymore. Do I have to configure everything using a direct path, then once I'm finished, set it to the environment variable? This seems awckward...

Pirooz,

Yes, this is the correct way. I can see how it could be improved like you suggest tho. Why not request it at Microsoft Connect?

-Jamie

sqlsql

Configuration Files

Hi,

I’m having

some issues associated with the configuration files that I can’t understand:

-

Having

a project with several packages using the same connections in each one (some

packages use all connection and others I just have some of them), why can’t I use

only one configuration file for all project. Assuming that I would have to

configure all packages at least I would like to use always the same file. On

the other way I would need 100’s of configuration files (one per package) to

configure always the same connection, just because not all the packages use

exactly the same connections.

-

Having

a configuration file on a machine, the package saves the full path, even if the

configuration file lays in the same path them the project. When I change my

project to another machine that doesn’t use the same file structure forces me

to open every package and change the configuration file location.

Having 100’s of packages and a team of

developers, even using the source safe, this makes the task just a little difficult

Thanks,
Vítor Ferreira

Sorry for the different fonts|||

Vítor Ferreira wrote:

Hi,

I’m having some issues associated with the configuration files that I can’t understand:

- Having a project with several packages using the same connections in each one (some packages use all connection and others I just have some of them), why can’t I use only one configuration file for all project. Assuming that I would have to configure all packages at least I would like to use always the same file. On the other way I would need 100’s of configuration files (one per package) to configure always the same connection, just because not all the packages use exactly the same connections.

It is perfectly possible to do this (i.e. share a .dtsconfig file around multiple packages). I'd like to understand why you think it cannot be done.

Admittedly you do have the problem that if a config file references a property that doesn't exist in the package in which it is being used then you will get an error. I have asked for this behaviour to change in the future and I believe it will be.

In the meantime, I aways recommend that you should rationalise your configuration files - splitting them up so that you don't encounter the problem I just spoke of. On the project I have just completed we used a seperate config file for every single Connection Manager and this worked fantasically well because we could easily share config files between seperate packages - I would always take this approach in the future. In fact, I recommend it in my suggested best practices: http://blogs.conchango.com/jamiethomson/archive/2006/01/05/2554.aspx (number 14).

Vítor Ferreira wrote:

- Having a configuration file on a machine, the package saves the full path, even if the configuration file lays in the same path them the project. When I change my project to another machine that doesn’t use the same file structure forces me to open every package and change the configuration file location.

This is why you should use something else I always recommend - Indirect Configurations: http://blogs.conchango.com/jamiethomson/archive/2005/11/02/2342.aspx

Hope that helps!

-Jamie

|||

Jamie,

It works just like you said, that's why i mentioned that i had packages not

always using the same connection, because if they all have the same connections

or variables used in the configuration file, I have no error. I already have

thought on the approach you have mentioned, one configuration file for

connection, and it’s probably the best solution.

Thanks,

Vítor

Ferreira

|||

Vítor Ferreira wrote:

Jamie,
It works just like you said, that's why i mentioned that i had packages not always using the same connection, because if they all have the same connections or variables used in the configuration file, I have no error. I already have thought on the approach you have mentioned, one configuration file for connection, and it’s probably the best solution.

Thanks,

Vítor Ferreira

Absolutely!!

Its definately the way forward in this scenario. Also, if you use indirect configs its even easier to edit your package configurations because its simply a matter of selecting an environment variable from a list. It works really well!

-Jamie

|||

I would suggest that the indirect configuration feature be augmented to support configuring the root path of configurations from an environment variable. Then just configure the remaining path portion or filename from the designer.

This would allow a single environment variable for a set of packages and each package would just have the configuration file name that is maintained.

Fred

|||

Jamie,

Correct me if I am wrong, but to use environment variables to configure the

configuration files path, I will need to use one environment variable for each

configuration file, even if they lay all in the same directory!?

Thanks,
Vítor|||

Vítor Ferreira wrote:

Jamie,
Correct me if I am wrong, but to use environment variables to configure the configuration files path, I will need to use one environment variable for each configuration file, even if they lay all in the same directory!?

Thanks,
Vítor

Vitor,

Correct. That's the approach we used on my last project and we were really happy with it.

-Jamie

|||I'm trying to setup my indirect configuration path using environment variables. I have an environment variable that contains the location of the configuration file. Once I do that I don't have the option to export any variables to this file anymore. Do I have to configure everything using a direct path, then once I'm finished, set it to the environment variable? This seems awckward...|||

Pirooz Javan wrote:

I'm trying to setup my indirect configuration path using environment variables. I have an environment variable that contains the location of the configuration file. Once I do that I don't have the option to export any variables to this file anymore. Do I have to configure everything using a direct path, then once I'm finished, set it to the environment variable? This seems awckward...

Pirooz,

Yes, this is the correct way. I can see how it could be improved like you suggest tho. Why not request it at Microsoft Connect?

-Jamie

Configuration file reused by different packages

I have two packages share same configuration file. There are 4 connections in the first package and 2 connections in the second. Configuration file contains properties for 4 connections. First package opens in VS designer with no error. The problem with second package.

I get error that connection exist in the configuration but not in the package

and

"Could not copy file " Master_Configuration.dtsConfig" to the deployment utility output directory. Master_Configuration.dtsConfig' already exists."

Any help?

For the former error, I'd suggest just using one config per connection. It may seem annoying but over a large project it works quite well and offers flexibility. If you do have common connections in all packages, then you can group them, but even that is not necessary.

Not really used the deployment tool, so cannot comment on the second error.

|||

It is more convenient to use one (master) configuration file. I use dtexec utility to run packages in production. With many config files I would have to dynamically bild /ConfigFile parameter for each file for each package.

|||I would set the configurations at design-time. I think this is a much better option all round. It is easy to change development systems, and ensures you can use the ProtectionLevel DontSaveSensitive option even if you require passwords for connections without any problems. Using indirect configurations means you can handle changing paths for your config files as you move through environments.

Sunday, March 25, 2012

Configuration Changes

We store our configurations in a SQL Server configuration table. We have SSIS packages that can be used in different senarios. Each of these senarios requires different configuration values.

Is it possible to change the SSIS configuration key used for a package at run time? i.e. we'd like to be able to use a job that says run this SSIS package but use configuration values with that name.

I think this is possible, yeah. If your packages need to be executed in different scenarios then you effectively need to "parameterise" those packages. Is that correct?

If so, you should lookat using the /SET option of dtexec.exe. It is provided for just this situation.

Configurations aren't really what you after. They are more about making your packages location independent, whereas it seems to me that you want to parameterise your packages.

Good luck with it.

-Jamie

|||

Thanks. We'll have to think through this a bit. *If* we could change the filter at package invocation then configurations would fit our needs perfectly. We'll probabbly look for a way to set several SSIS variables from a SQL table and use a /SET to specify which set of values to populate variables from.

I think we could pull it off with configurations using multiple tables, but I'm not fond of that either. I guess it's rough to be picky. :)

|||That's the point of configuration tables in SQL Server though -- to make things flexible...

Perhaps you could store your multiple configurations in a table and then with a stored procedure or something, update the SSIS Configuration table with the appropriate values.|||

We actually do that for sub packages, but it doesn't seem appropriate here. If I update the single set of SSIS values from two different jobs at close to the same time, it's likely one of them will run with the wrong values. Tracking that down seems like more effort than I'd like to spend if it occured.

My colleague had an idea we're investigating. Using environment values. We're thinking that perhaps by creating a batch file that sets a value on the fly and then issues a dtexec that we might achieve the result we want without putting values permanently into the evironment or exposing sensitive data.

|||

Ok, I think we have it working. We created a batch file called SSISWithConfiguration.bat:
SET env="Configuration";"[dbo].[SSIS Configurations]";%2
dtexec /DTS %1

In the job we just pass the path to the SSIS package and the Configuration filter values we want to use. The environment variables will be separate for each invocation and we only have one batch file to deploy ever. (We always call a configuration connection called Configuration). Execution looks like:
C:\MSSQL\SSISWithConfiguration.bat "\MSDB\folder\packageName" "New filter name"

In the package we just create an indirect SQL Server configuration with the environment variable as env.

During development we can use configuration settings directly and then when ready to deploy a reusable package switch to indirect (that way we don't have to have permanent environment variables on the developers desktops and the configuration table in development will get updated).

Finally, in the package, we have an XML file configuration listed first to move the Configuration connection between development, test, and production. This gets deployed once on each developers box and once on each server.

The last piece we wrote was a small utility that will let us pick a configuration setting and will write the SQL script to insert the configuration settings after deleting any existing values. We save that three times and change the values for development, test, and production.

Thanks for all the ideas and support. Sometimes it's just looking at stuff a bit different :)

Configuration Approach

Background

I use four database connections strings.

I have about 30 packages that will use one or more of the connection stings.

I store the connection strings in XML configuration files.

I know that I can share configuration files across packages. Should I ?

    Have one configuration file with all 4 connection strings? If I use this approach will I get errors in the packages that only use 1 of the connection strings OR

    Create four separate configuration files (CnnString1.dtsconfig, CnnString2.dtsconfig, CnnString3.dtsconfig, CnnString4.dtsconfig) and use the appropriate ones for each package

    Take another approach

Check this thread, It discusses the similar kind of issue.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1853477&SiteID=1

Thanks

|||For me, I just create all of the connection managers that are in the config file across all packages for a given project. It's a pain to setup, but it works for me.|||

That is the pain I am striving to avoid by using a modular approach. I know that having a configuration file for each package works but it is not reusable. That can cause a maintenance nightmare when moving 30+ packages between Dev, QA & Prod environments.

I have a requirement to use XML Configuration files. Returning to the original question, should I use 1 file with all database connections or should I use 4 files with a connection in each?

|||

Danny Crowell wrote:

That is the pain I am striving to avoid by using a modular approach. I know that having a configuration file for each package works but it is not reusable. That can cause a maintenance nightmare when moving 30+ packages between Dev, QA & Prod environments.

I have a requirement to use XML Configuration files. Returning to the original question, should I use 1 file with all database connections or should I use 4 files with a connection in each?

If it's such a pain, then use a configuration file for each connection manager object. Then each package only uses what it needs.

Config files get lost...

I created a project with multiple packages. I created a global

config file that all packages reference. I also created a config file

for each package that contains the package specific settings. I

checked it all into TFS. I went to a different machine and checked it

all out. Upon loading a package into the IDE I got the following 3

warnings.

Warning loading MT_LSE_PROD_StageLoad.dtsx: The

configuration file "MT_LSE_PROD_StageLoad.dtsConfig" cannot be found.

Check the directory and file name.

e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Warning

loading MT_LSE_PROD_StageLoad.dtsx: The configuration file

"Environment.dtsConfig" cannot be found. Check the directory and file

name. e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Warning

loading MT_LSE_PROD_StageLoad.dtsx: Failed to load at least one of the

configuration entries for the package. Check configurations entries and

previous warnings to see descriptions of which configuration failed.

e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Any

ideas? And yes, the files *ARE* there! I tried building the project

and it builds. I also tried doing a deployment build and that too

built. I am so confused!!!

StarPilot wrote:

I created a project with multiple packages. I created a global config file that all packages reference. I also created a config file for each package that contains the package specific settings. I checked it all into TFS. I went to a different machine and checked it all out. Upon loading a package into the IDE I got the following 3 warnings.

Warning loading MT_LSE_PROD_StageLoad.dtsx: The configuration file "MT_LSE_PROD_StageLoad.dtsConfig" cannot be found. Check the directory and file name. e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Warning loading MT_LSE_PROD_StageLoad.dtsx: The configuration file "Environment.dtsConfig" cannot be found. Check the directory and file name. e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Warning loading MT_LSE_PROD_StageLoad.dtsx: Failed to load at least one of the configuration entries for the package. Check configurations entries and previous warnings to see descriptions of which configuration failed. e:\contentloader\sprint1a\MT_LSE_PROD_StageLoad.dtsx

Any ideas? And yes, the files *ARE* there! I tried building the project and it builds. I also tried doing a deployment build and that too built. I am so confused!!!

Could it be a permissions issue? I assume the account running the packages has access to e:\contentloader\sprint1a\

-Jamie

|||Not a permission issue. I've granted every account access to the file system (one of the "joys" of being in a dev environment). Also, I see this behavior in VS.NET not SQL. I do a get latest or check out of the project on a brand new dev machine and it is VS.NET giving me the warnings. I compile (ignoring the warnings) and it works just fine. I turn deployment on and build and the deployment directory has the packages and config files. So, they are there and being used - it's VS.NET that's winpering over it...

config file question

In my SSIS packages I'm adding a config file that is storing only the connection strings to the database. Though most of my packages are reading or writing out flat files as well as connecting to a db. Do I need to put both db connection string and flat file connection strings in the config file? I'm currently adding only the db connection due to that will change depending which environment its ran in, unlike the flat file location will always remain the same.

I just want to be sure I don't need both for my package to run successfully.

You can add only 1 or as many configuration values as you want in a single file. As a good practice you should have both values set via configurations; just to cover a possible change in the flat file location. You could also create a separate config file for each property.

Sunday, March 11, 2012

Conditional Running of DTS Jobs

We have several DTS packages run as SQL Agent jobs using DTSRUN methods.
However, there are certain specific holidays we don't want to run these jobs
that are stored in a holiday table. Since parameters can't be passed between
job steps, what is the best way for aborting the job on a specific day
without running the DTS job? Is there a way to set a success or failure flag
in jobs and use this flag to abort before running the next job step?
--
Larry Menzin
American Techsystems Corp.Couldn't you check your holiday table in each job step, using sql...for
example...
/*get today*/
select @.today = (select getdate())
/*if today isn't in the holiday table then kick off dts job*/
if not exists (select * from holiday_table where holiday = @.today)
xp_cmdshell 'dtsrun .....blah, blah'
Not sure if my syntax is quite right, and not sure how your dates are
formatted, but something like this should work.|||You could also create a job step as the first step, that checks the date and
fails the job.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Larry Menzin" <LarryMenzin@.discussions.microsoft.com> wrote in message
news:624FC617-C35C-4FDF-95F9-D31C5349C85D@.microsoft.com...
> We have several DTS packages run as SQL Agent jobs using DTSRUN methods.
> However, there are certain specific holidays we don't want to run these
> jobs
> that are stored in a holiday table. Since parameters can't be passed
> between
> job steps, what is the best way for aborting the job on a specific day
> without running the DTS job? Is there a way to set a success or failure
> flag
> in jobs and use this flag to abort before running the next job step?
> --
> Larry Menzin
> American Techsystems Corp.

Conditional Running of DTS Jobs

We have several DTS packages run as SQL Agent jobs using DTSRUN methods.
However, there are certain specific holidays we don't want to run these jobs
that are stored in a holiday table. Since parameters can't be passed between
job steps, what is the best way for aborting the job on a specific day
without running the DTS job? Is there a way to set a success or failure flag
in jobs and use this flag to abort before running the next job step?
Larry Menzin
American Techsystems Corp.
Couldn't you check your holiday table in each job step, using sql...for
example...
/*get today*/
select @.today = (select getdate())
/*if today isn't in the holiday table then kick off dts job*/
if not exists (select * from holiday_table where holiday = @.today)
xp_cmdshell 'dtsrun .....blah, blah'
Not sure if my syntax is quite right, and not sure how your dates are
formatted, but something like this should work.
|||You could also create a job step as the first step, that checks the date and
fails the job.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Larry Menzin" <LarryMenzin@.discussions.microsoft.com> wrote in message
news:624FC617-C35C-4FDF-95F9-D31C5349C85D@.microsoft.com...
> We have several DTS packages run as SQL Agent jobs using DTSRUN methods.
> However, there are certain specific holidays we don't want to run these
> jobs
> that are stored in a holiday table. Since parameters can't be passed
> between
> job steps, what is the best way for aborting the job on a specific day
> without running the DTS job? Is there a way to set a success or failure
> flag
> in jobs and use this flag to abort before running the next job step?
> --
> Larry Menzin
> American Techsystems Corp.

Conditional Running of DTS Jobs

We have several DTS packages run as SQL Agent jobs using DTSRUN methods.
However, there are certain specific holidays we don't want to run these jobs
that are stored in a holiday table. Since parameters can't be passed between
job steps, what is the best way for aborting the job on a specific day
without running the DTS job? Is there a way to set a success or failure flag
in jobs and use this flag to abort before running the next job step?
--
Larry Menzin
American Techsystems Corp.Couldn't you check your holiday table in each job step, using sql...for
example...
/*get today*/
select @.today = (select getdate())
/*if today isn't in the holiday table then kick off dts job*/
if not exists (select * from holiday_table where holiday = @.today)
xp_cmdshell 'dtsrun .....blah, blah'
Not sure if my syntax is quite right, and not sure how your dates are
formatted, but something like this should work.|||You could also create a job step as the first step, that checks the date and
fails the job.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Larry Menzin" <LarryMenzin@.discussions.microsoft.com> wrote in message
news:624FC617-C35C-4FDF-95F9-D31C5349C85D@.microsoft.com...
> We have several DTS packages run as SQL Agent jobs using DTSRUN methods.
> However, there are certain specific holidays we don't want to run these
> jobs
> that are stored in a holiday table. Since parameters can't be passed
> between
> job steps, what is the best way for aborting the job on a specific day
> without running the DTS job? Is there a way to set a success or failure
> flag
> in jobs and use this flag to abort before running the next job step?
> --
> Larry Menzin
> American Techsystems Corp.