Problem setting Package Variables in SSIS Package
Hi, I am making use of the DtUtil tool to deploy my package to SQL Server.Following is my configuration:32-bit machine and 32-bit named instance of Yukon. I have some package variables which need to be set in the code. Previously I did it as follows: Set the package variables in the code. For example: pkgFile.Variables["User::DestinationServerName"].Value = <myvalue> Deploy the package as follows: applnObj.SaveToSqlServer(pkgFile, null, destinationServer, null, null); Here the package was successfully deployed and when i open those packages using BIDS, I am able to see that the variables are set to the values as doen in teh code. Because of oen problem I am not using SaveToSQLServer method. So I switched to DTUtil tool.Now I am doing it this way: Set the package variables as before. Deploy the package to SQL Server using DTUtil tool. Now is the problem:The package is successfully deployed. But the variables are not set to the value that I have specified in the code. I also tried DTexec utility to set the package variable. Even that does n't work. Can anyone help me out? Is there any alternate method to set package variables? Thanks,Sandhya
September 8th, 2006 1:03am

I am not sure what you mean by setting the package variables in the code. Are you referring to the code in a script task?To dynamically update variables, you can create configurations for the variables, deploy the configurations with the package, and then update the variable values in the configuration file when you deploy the packages. At run time, the package uses the updated variable values. For more information, see Creating Package Configurations.
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2006 12:47pm

sandyJ wrote: Now I am doing it this way: Set the package variables as before. Deploy the package to SQL Server using DTUtil tool. Now is the problem:The package is successfully deployed. But the variables are not set to the value that I have specified in the code. Do you save the package after modifying the variables? :) Any modifications to thepackage are done to the in-memory copy of the package, you need to save this modified package to original location for your modifications to have any effect on the file.
September 8th, 2006 1:03pm

Hi, Its resolved noiw. the problem was that I was not making use of the package object (using which i set the package ariables to the required values) in DTUtil. That was the reason why the variables were not getting modified. My requirement id that I need to save the package to MSDN folder. Now I am doing it this way: Set the package variables Use SaveToDtsServer method to save the package to File system folder in Integration Services. (Im doing this because when I use SavetoSQLServer method, I am getting a 'Communication Link Failure' error.) Copy the package from File System to MSDB folder in Integration Services. Delete the package from File System folder in Integration Services. Now my package is successfully deployed and the variables are also set accordingly. But is there a way by which I can save the modified package to the local system's physical location rather than the File System folder in Integration Services?
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2006 1:07pm

sandyJ wrote: But is there a way by which I can save the modified package to the local system's physical location rather than the File System folder in Integration Services? Of course: use Application.SaveToXml method - it takes file name and package.
September 9th, 2006 4:55pm

Hi, Visual Studio gives the defenition for SaveToXml mehtod as follows: The Name of the xml file to save the package as. Make sure to add the XML file name extension to the name. Why is there a reference to xml while we are actually saving a dtsx package to a physical location? Is n't this misleading? Thanks, Sandhya
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2006 9:08am

Indeed, the text is misleading, I agree with you. I'll send notice todocumentation guys. You can also send comments at the bottom of the page at msdn page.The package format is indeed XML, but it is common to give packages .DTSX extention to show they are SSIS packages.BTW, SSIS usually does not care about the file extention (except the designer project system) - so you'll be able to execute a package even if it has .XML extention.
September 11th, 2006 4:12pm

Hi, I have added my comment in the link. Thanks for the info.
Free Windows Admin Tool Kit Click here and download it now
September 13th, 2006 7:04am

I have two types of SSIS packages 1.*.dtsConfig file is one need to deploy 2.There are 10 different *.dtsConfig files according to server environment need to deploy, For perticular last server enviorment these errors are there, This server is NEW in last environment and need to configure more efficiently that I do understand but this is not sure reason pic is attach, problem is not still solved --Himanshu Kulkarni, Mark the thread as answered if the answer helps you. This helps others who have the same problem !!!
June 11th, 2012 3:21am

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

Other recent topics Other recent topics