DTSrun with variable -
06-30-2004
, 09:33 PM
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.
nntp://news.sf.sbcglobal.net/microsoft.public.sqlserver.dts/<#xyQHxtXEHA.3552 (AT) TK2MSFTNGP12 (DOT) 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
[microsoft.public.sqlserver.dts] |