February 17, 2005 at 7:36 am
I am trying to execute a DTS package using a stored procedure and pass two globalvariables to the DTS package. The DTS package executes but uses the default globalvariable values instead of the ones passed. This is the dts command line being put together by the stored procedure.
dtsrun /Spsi /Usa /P***** /Nlfucg /A"periodstart":"8"="01/01/2005" /A"periodend":"8"="01/31/2005"
I have tried changing my globalvariable to "date" and changing the typeid to 7 but that didn't work either.
Please help.
February 17, 2005 at 9:20 am
James,
Try leaving the Global Variables in the package empty (delete the values and save the package). I have had issue with this on occassion.
Good Luck,
Darrell
February 17, 2005 at 9:25 am
I tried that but the DTS package errors out now when trying to run because the globalvariables values are not coming in.
February 17, 2005 at 9:49 am
James,
I missed it in the original post - remove the quotes from around the 8 (typeid).
February 17, 2005 at 10:28 am
That didn't work either. If I set the globalvariable values in properties of the DTS package the package works but uses the values I put in the properties page. If I take them out the package fails. It seems like the globalvariables aren't being passed to the DTS package.
February 17, 2005 at 10:48 am
James,
I just created a test DTS package that writes the Global Variables values out to a text file. The variables are empty in the package. I executed the package from Query Analyser with the following statement:
xp_cmdshell 'DTSRUN /S (local) /E /N WTest /A"periodstart":8="01/01/2005" /A"periodend":8="01/31/2005"'
And it wrote the correct values out. The Global Variable names are case sensitive - other than that I am out of ideas at the moment.
February 17, 2005 at 10:52 am
WOW, that was it. I wasn't aware that the globalvariables were case sensitive. It is always the simple things that cause the biggest problems.
Thanks so much for all your help.
February 17, 2005 at 10:53 am
No Problem - glad it was that simple!!
February 18, 2005 at 11:57 am
Here's a clever solution (now that you already have one . But this works for all cases.
Under your SQLServer install, execute the utility called "dtsrunui.exe" (in Tools). Choose your package and click "Advanced". Set your global variables and click "Generate". voila! You have a DTSRun command all set up for you, including setting the global variables.
Much easier than doing that crap by hand.
cl
Signature is NULL
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply