Controlling Default Values for Configurable Connection Manager Properties
Okay. My first thought was to do that in the package, but I'll try catching this in the Job for now. Is there any way to get the specific warning? Do I need to enable package logging to get that? It would be helpful if I could get something more specific than what is offered in the Job History failure notice; 'The command line parameters were invalid'. I know where to get to those, but it would help if I could capture the warning.
January 28th, 2011 10:55pm

Thanks for the link. This package is executed by a SQL Server 2008 Job. I think I understand what the article is trying to express. How, in the package, do I 'detect' whether or not the config file was supplied? Can that be done through an Event Handler like OnPreValidate or OnPreExecute at the package level?
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2011 11:01pm

How do you execute your package?Arthur My Blog
January 28th, 2011 11:16pm

The package is stored on the file system and executed by a SQL Server 2008 Job. I have two different .dtsConfig files that are configured in the job. I just ran a test to see what would happen if I removed the config files from the location as shown in the Job set up, then ran the job. The job successfully ran the package anyway. How could the job run the package if the config files were not located in the correct location? The config files contain the connection information to the server and database.
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2011 12:11am

Yes. You need to specify a new location with the /Set option.Arthur My Blog
January 29th, 2011 12:20am

I'm not sure I am clear on this idea. I understand using package variables to drive configurable properties. What I want to do is to have the server and database names to be something like 'None' if the xml configuration values can't be captured at runtime. It seems like Reza's idea would compensate for the absence of the xml configuration value, and configure a valid server name anyway. What am I missing? Thanks again.
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2011 12:25am

I'm not running the package from the command prompt with dtexec. To further expand on the problem, the config files were moved, and I didn't know it because the job/package continued to run. If the config files are moved, and I don't know about it, the job/package need to fail. With the configuration files located to a different place, and if I set a breakpoint OnPreExecute at the package level, then execute the package in BIDS, the following is returned: Warning: The configuration file "\\oracle\ETL\ETLConfigurations\Global.dtsConfig" cannot be found. Check the directory and file name. At this point, I want the package to fail.
January 29th, 2011 12:30am

I think all you need is some sort of control flow in your package, well first, at the validation stage, if the config file is not found the package will not run, or you had it modified to compensate for this event with something like inhibiting the error and using a precedence constraint to execute some other task (redirect)? Besides, if the config file is missing it is a bizarre situation on its own or you plan to have it as an option, I do not get this scenario.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2011 12:32am

No , I didn't considered absence of xml configuration value. the solution I provided will force package to connect to default server name if configuration value is "None"http://www.rad.pasfu.com
January 29th, 2011 12:33am

In my SSIS package, I have a connection manager that uses the OLE DB Provider for SQL Server. I want to configure the ServerName property in an xml configuration. I want to do this in such a way that if, for whatever reason, the package cannot 'find' the configuration file at runtime, the ServerName property has a value of 'none' instead of the real server name. I've tried the following: 1. Configured the connection manager with a 'real' ServerName value. 2. Created an xml package configuration file to store ServerName. 3. Disabled Package Configurations 4. Changed the ServerName to None. 5. Reenabled Package Configurations 6. ServerName changes back to the real server name 7. If I disconnect again, the real ServerName from the package configuration remains. It does not flip back to 'None'. Is there a way to control configurable connection manager properties so that I don't have a valid ServerName 'default' value? Thank you for your help! cdun2
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2011 12:40am

use Fail the package on validation warnings found on the Execution options tab of the job step.Arthur My Blog
January 29th, 2011 12:41am

Okay, I thought so. The thing I want to have happen is for the package to fail if the package cannot get its configuration information from the xml file. The particular problem I have is that, recently, the xml configuration file that the package was configured to was moved. The package ran based on server and database values that were something other than what the intended configuration file had in them. How do I validate whether or not the package is using config file values, and fail the package if it isn't doing that?
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2011 12:41am

Then you only need to know how the config settings are applied, there is a difference between version 2005 and 2008. Please read this post on specifics: http://dougbert.com/blogs/dougbert/archive/2009/04/07/understand-how-ssis-package-configurations-are-applied.aspx You would need to make the package failed if the config file was not supplied.Arthur My Blog
January 29th, 2011 12:46am

You can do it with resort of package variable, create a package variable for Server name, in package scope, data type string, name it for example ServerNameVariable. right click on the connection manager which you want to make server name dynamic, then select properties, then in properties window click on expression, then set expression property as ServerName and set Variable as ServerNameVariable. Note that you should set a valid servername value for this variable for ssis validation phase. then,put a script task at the begining of your package , set the ServerNameVariable as ReadWriteVariables, then write this script in main method: If(Dts.Variables["User::ServerNameVariable"].Value.ToString()=="None") { Dts.Variables["User::ServerNameVariable"].Value="put your default server name here"; } http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2011 12:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics