We have a SSIS job called ExportData and it accepts the ‘ExportType’ Parameter. The ExportType parameter can be ‘schedule’ or ‘unschedule’.
I created the Variable called ‘@ExportType’ and created the SSIS Configuration and expose the variable in the Configuration file and called it ‘ScheduleConfig’. I copied that file and change the value to ‘unschedule’ and called it ‘UnscheduleConfig’.
I created the SSIS Job in the SQL Server 2008 and set up 2 steps for both ‘Schedule’ and ‘Unschedule’. I attached the correct config file for each Step. But whichever step I run, it always execute ‘Schedule’. I am sure and double checked the Config files and Steps.
How can I run 2 different jobs with 2 different configuration files?
I did try by using the SetValues method and it doesn’t work too.
If I understand your requirements correctly. here is a sample package created in
SSIS 2008 R2and does what you are looking for. The sample uses a single package, which is executed under two different SQL agent job steps and both the steps use a different copies of the same configuration file. The configuration files hold different values for the variable used inside the package.SO_10177578. Within the package, created a package variable namedExportTypeof data typeString. Also, placed theExecute SQL Taskon the Control Flow tab. This task will help to identify the value being passed to the variableExportType.SQLServer. I chose to use SQL Server authentication for this connection manager.dbo.ExportDatawith the following strucutre.Idcolumn is a identity column.SSISmenu –> selectedPackage Configurationoption. On the Package Configurations Organizer dialog, selected the Enable package configurations checkbox and clicked on the Add button. Created a new package configuration of the typeXML Configuration file. Selected a path to store the file.ExportTypeand the ConnectionString property of the connection managerSQLServerto the configuration file.SQLServerand set the SQLStatement property toINSERT INTO dbo.ExportData (PackageName, ExportTypeValue) VALUES (?, ?)Test_ExportData.Ownerfield information is removed to hide sensitive information.Step_01andStep_02.c:\temp\SO_10177578.dtsx.ExportTypeto Schedule. Named the configuration file asScheduleConfig.dtsConfig. Screenshot shows only part of the configuration file to hide sensitive connection string information.c:\temp\Test\ScheduleConfig.dtsConfig.c:\temp\SO_10177578.dtsxas used by step 1.ExportTypeto Unschedule. Named the configuration file asUnscheduleConfig.dtsConfig. Screenshot shows only part of the configuration file to hide sensitive connection string information.c:\temp\Test\UnscheduleConfig.dtsConfig.ExportData. You can notice that the package was executed twice and each execution in the SQL agent job’s steps used the appropriate configuration files specified on the steps.Hope that helps.