Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS and master..xp_cmdshell

Status
Not open for further replies.

hanglam

Programmer
Dec 11, 2002
143
US
Hi,

I have stored procedure that called the dtsrun.exe but the command-line does not overwrite my global variables.

declare @cmd varchar(50)

set @cmd = 'DTSRun /S "(local)" /U "user" /P "pass" /N "test" /A "one":"3"="1" /A "two":"3"="2" /W "0"'

exec master..xp_cmdshell @cmd

I want to be able to pass in parameters to the DTS Package, I'm sure the "/A" option will let me pass any value to the global variables that I set up for my DTS Package, but for some reason my DTS package is not taking these parameters. It does overwrite the values of the global variables in my DTS package.

Any idea why this is happening ?

Thanks,
Hang
 
Correction:

IT DOES NOT overwrite the values of the global variables in my DTS package .

Thanks,
Hang
 
Don't know if this a trick question, but with
@cmd varchar(50)
string length stops at: /N "test"
so no wonder your command line parameters are not passed...

"overwrite the values", does or does not, not the cause.

Not this case particulary, but philosophy corner: One must never assume the reason of a problem or try to find a workaround before you know the actual cause. And always find time to bang your head against the wall. And, never be afraid to start over from scratch. One more, a professional is a person, who knows what he doesn't know.

:) Best Regards


[blue]Backup system is as good as the latest recovery[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top