Re: DTSrun with variable
From: DJohnson (thesquare_at_hotmail.com)
Date: 07/01/04
- Next message: jengga: "DTS package fails to run on client PC"
- Previous message: Alexander Nenashev: "strange errors in execute sql task"
- In reply to: Randy Lane: "Re: DTSrun with variable"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 1 Jul 2004 08:31:42 -0700
Thanks Randy.. it worked like a charm.
Man I love you guys!!! (in a strictly professional way)
D.Johnson
"Randy Lane" <rmathuln@pacbell.net> wrote in message
news:ZSKEc.6579$PF2.997@newssvr27.news.prodigy.com...
> DECLARE @@DtsRunText varchar(64)
>
> SET @@DtsRunText = 'EXEC xp_cmdshell ''dtsrun /Ssomesql /Usa /Ppass /NTEST
> /A' + MyVar + ''''
>
> EXEC(@@DtsRunText)
>
> If MyVar is character, you'll have to add additional quotes before and
after
> the insertion of the variable into the @@DtsRunText string.
>
>
> "Sumbody" <Sum@microban.com> wrote in message
> news:%23xyQHxtXEHA.3552@TK2MSFTNGP12.phx.gbl...
> > Hi All,
> >
> > I finally got the DTS run to work with my new package thanks to Allan
> > Mitchell.... Now my question is this:
> >
> > How do I pass the Dtsrun command line a variable?
> >
> > EXEC xp_cmdshell 'dtsrun /Ssomesql /Usa /Ppass /NTEST /AMyVar:8=Mydata'
> >
> > The above line works great as long as I hard code the value of MyVar....
> my
> > challenge now is to put this in a stored proc and pass in the value of
> > MyVar.
> >
> > So basically I need to deal with
> >
> > CREATE PROCEDURE spGetParcelTrans
> > @TransNo int
> > AS
> > EXEC xp_cmdshell 'dtsrun /Ssomesql /Usa /Ppass /NTEST /AMyVar:8='
> >
> > So how do I deal with MyVar & @TransNo ????
> >
> > TIA
> >
> > D. Johnson
> >
> >
> >
>
>
- Next message: jengga: "DTS package fails to run on client PC"
- Previous message: Alexander Nenashev: "strange errors in execute sql task"
- In reply to: Randy Lane: "Re: DTSrun with variable"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|