Passing parameter when running SSIS
H I have question and not sure ssis can do that I have one store procedure that has one date as a parameter like exec Employeehiredate '10/10/1998' now i want in "Execute Sql task" such that when i run this package from server after deployment i can set date value and it will run package by taking that value. Please let me know if this is achievable or not or how to achieve this.
November 2nd, 2010 7:11pm

Yes, this can be done easily. First, you need to re-structure the Execute SQL task to use a Variable instead of a hard-coded date. Add a Date type variable with a name of your choice. Give it a valid value. Change the statement to "EXEC EmployeeHireDate ?". Add a parameter mapping to your variable. Test run the package to ensure it works. now the next part: read BOL on DTEXEC command line utility and the DTEsecUI graphical tool. With those you can execute a package and assign (override) values to variables and other properties at run-time. This is a fairly standard operation and should not give you much trouble, but check back here if you do.Todd C - MSCTS SQL Server 2005 - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2010 8:23pm

You could achieve this by populating a user variable from a package configuration. The package configuration could then be updated prior to running the package. The Execute SQL task then uses the value of the variable for the stored proc parameter. Hope this helpsCraig Bryden - Please mark correct answers
November 2nd, 2010 8:25pm

Thanks Craig as i have not ever set package configuration can you explain some step to achive that
Free Windows Admin Tool Kit Click here and download it now
November 3rd, 2010 12:37pm

For configurations, right-click the Control Flow and select Configurations. Follow the prompts to save to an XML file, and save only the Value property of the variable in question. But really, this just adds an extra step to the process because you need to FIRST over-write the file by supplying a new value for the parameter, then invoke the package. Let me ask you this: "How are you invoking the package execution on the server?" From a SQL Agent job? Using DTExec or DTExecUI? Using a Stored Procedure with cmdexec? Some other third party tool? VB.Net or C# Code? Depending on the answer, you may be able to simply put in a /SET switch in the command line to set the Value of the variable in the package directly, bypassing the Config file. Don't get me wrong, Configurations are conderful things, but may not be the best approach in this situation.Todd C - MSCTS SQL Server 2005 - Please mark posts as answered where appropriate.
November 3rd, 2010 12:48pm

currently i just create package and deploy that to integration server and then right click on package and run(FROM SERVER) so i want that configuration like some thing will be there in config folder i just need to change that and package take that value currently i have created variable @Startdate can you help me to make config filefor same ?
Free Windows Admin Tool Kit Click here and download it now
November 3rd, 2010 1:19pm

I can help, but first let me explain that I'm more of a SQL guy than an XML guy. If I can solve a problem in SQL, I will, instead of going into 'other areas', XML being one of them. Right-click on the Control Flow of your package and select "Configurations". Click "Enable Configurations" then Add. Select XML as the type and create a folder path that is easy to get to. I use C:\SSIS_Config\ for mine. DON'T try to get smart and use mapped drives as drive letter change or may not be available. Specify a file name. Click OK or Next until you get to the point where you specify WHAT you are going to configure. At that point, browse the tree until you find Variables, then find yours [Startdate], and then expand Properties and find Value. Put a check for the Value property of your variable. Click Next and/or OK until you finish with the dialog box, giving your newly created Configuration a readable name. Now, and this is important, copy that XML file you just created from the folder you created and copy both the folder and file onto the server where SSIS is installed. It needs to be there for the run-time engine to find it. This file needs to exist in the exact same location as on your workstation. but now you can open it in Notepad or Wordpad and edit the <ConfiguredValue> tag to something else. When the package is run from the server, it will read this file and apply the ConfiguredValue and apply it. Now, be aware that if you run the package by openning SQL Server Management Studio, connecting to SSIS instance, then finding the package and running it, it MAY use the Config file on YOUR machine, NOT the server version of the file. You'll need to verify. If you schedule the package to run as a SQL Agent job, then it will definitely grab the file from the server.Todd C - MSCTS SQL Server 2005 - Please mark posts as answered where appropriate.
November 3rd, 2010 1:34pm

Thanks I am able to achive this still i want to learn how to achive this with other ways i will appreciate if you can explained me that thanks
Free Windows Admin Tool Kit Click here and download it now
November 3rd, 2010 1:58pm

Hi Todd still i have question i have deploye package and now when i try to run i have one copy of same config file on server but it is taking the same that use before when i try to run package i add config file but it is not taking that can you please explaine how to do that
November 3rd, 2010 2:11pm

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

Other recent topics Other recent topics