dbTalk Databases Forums  

DTS Global Variables and parameters

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Global Variables and parameters in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
M3ckon
 
Posts: n/a

Default DTS Global Variables and parameters - 04-15-2004 , 04:32 AM






I've writen an activeX script to get an xml doc from a url and then
assign one of the nodes to a global variable.

I then want to pass this variable to a SQL statement and thought I
could do this still using the DTS. So I set up a connection to my SQL
server and a sql command. The statement is:

Declare @partno nvarchar(255)

UPDATE productfeed
SET Stock = '99'
WHERE Manufacturer_Part_Number = @partno

Yet when I clcik the parameter button in the DTS for the SQL Command,
I get told, 'The SQL statemetn does not contain any parameters'

Can someone help me please as I need to pass the global var to this
statement as a parameter

Keith

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: DTS Global Variables and parameters - 04-15-2004 , 04:40 AM






change @partno to ?

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"M3ckon" <keith (AT) syance (DOT) com> wrote

Quote:
I've writen an activeX script to get an xml doc from a url and then
assign one of the nodes to a global variable.

I then want to pass this variable to a SQL statement and thought I
could do this still using the DTS. So I set up a connection to my SQL
server and a sql command. The statement is:

Declare @partno nvarchar(255)

UPDATE productfeed
SET Stock = '99'
WHERE Manufacturer_Part_Number = @partno

Yet when I clcik the parameter button in the DTS for the SQL Command,
I get told, 'The SQL statemetn does not contain any parameters'

Can someone help me please as I need to pass the global var to this
statement as a parameter

Keith



Reply With Quote
  #3  
Old   
m3ckon
 
Posts: n/a

Default Re: DTS Global Variables and parameters - 04-15-2004 , 05:32 AM





thanks Alan,

sorry to be a pain, but how do I have several parameters??


can I just name them
?param1
?param2

Regards,

M3ckon

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: DTS Global Variables and parameters - 04-15-2004 , 05:50 AM



you just do

WHERE col1 = ? and col2 = ?

When you look at them in the DTS parameters section they are in order.


--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"m3ckon" <anonymous (AT) devdex (DOT) com> wrote

Quote:

thanks Alan,

sorry to be a pain, but how do I have several parameters??


can I just name them
?param1
?param2

Regards,

M3ckon

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.