Sunday, February 26, 2012

dtsrun to start a package - cannot find xp_cmdshell

Newbie here.

In my database I'm needing to automate some data imports. I have the
import set up as a DTS package and it works wonderfully. But I'm
having trouble kicking it off as a stored procedure, or even from the
Query Analyzer. I used dtsrunui to get a proper connection string, but
when I enter

EXEC xp_cmdshell 'dtsrun /S "(local)" /N "MyPackage" /A
"KeyNum":"19"="19687627" /W "0" /E'

I get an error that says "Could not find stored procedure
'xp_cmdshell'". xp_cmdshell is indeed there, under Master, Extended
Procedures. I tried calling it dbo.xp_cmdshell, but that didn't help.
I'm guessing that I need to point the command to the location of the
SP, but I have no idea how to do that. Anyone willing to shed a little
light would get my eternal gratitude. :)

Thanks in Advance, maddmanuse master first or add master. to the procedure name. xp's don't operate
like sp's where you can call them from any database.
kevin Ruggles

"Maddman" <maddman_75@.yahoo.com> wrote in message
news:1102626201.340243.92890@.f14g2000cwb.googlegro ups.com...
> Newbie here.
> In my database I'm needing to automate some data imports. I have the
> import set up as a DTS package and it works wonderfully. But I'm
> having trouble kicking it off as a stored procedure, or even from the
> Query Analyzer. I used dtsrunui to get a proper connection string, but
> when I enter
> EXEC xp_cmdshell 'dtsrun /S "(local)" /N "MyPackage" /A
> "KeyNum":"19"="19687627" /W "0" /E'
> I get an error that says "Could not find stored procedure
> 'xp_cmdshell'". xp_cmdshell is indeed there, under Master, Extended
> Procedures. I tried calling it dbo.xp_cmdshell, but that didn't help.
> I'm guessing that I need to point the command to the location of the
> SP, but I have no idea how to do that. Anyone willing to shed a little
> light would get my eternal gratitude. :)
> Thanks in Advance, maddman|||That did the trick. Thanks!

No comments:

Post a Comment