dbTalk Databases Forums  

Output vars

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


Discuss Output vars in the microsoft.public.sqlserver.dts forum.



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

Default Output vars - 07-10-2006 , 08:03 AM






Hi,

I've got a SQL taks in DTS 2000 and a global var with a float number. I try
to get the value of the parameter in the SQL task:

declare @Total float
update KPI set value=@Total where code=123

When I hit "Parameters" to map the variable, I get a message: Query does not
contain any parameters.

How can I fix this?
thanks

Reply With Quote
  #2  
Old   
Davide
 
Posts: n/a

Default Re: Output vars - 07-10-2006 , 08:14 AM






Hello Philippe,

Quote:
Hi,

I've got a SQL taks in DTS 2000 and a global var with a float number.
I try to get the value of the parameter in the SQL task:

declare @Total float
update KPI set value=@Total where code=123
When I hit "Parameters" to map the variable, I get a message: Query
does not contain any parameters.

How can I fix this?
thanks

Try simply this script :

update KPI set value= ? where code=123

and hit 'Parameters'

('?' should be the placeholder for your GVar)




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

Default Re: Output vars - 07-10-2006 , 08:27 AM



This problem is fixed :-)
But (there's always a but)

Whe I do this, the default value 0 which I specified in the glmobal
variables is written into the table instead of the variable value.

The SQL statement which gets the number out of the table works because I
tested it with Query Analyser. Is there a way to check this or what am I
doing wrong?


"Davide" wrote:

Quote:
Hello Philippe,

Hi,

I've got a SQL taks in DTS 2000 and a global var with a float number.
I try to get the value of the parameter in the SQL task:

declare @Total float
update KPI set value=@Total where code=123
When I hit "Parameters" to map the variable, I get a message: Query
does not contain any parameters.

How can I fix this?
thanks


Try simply this script :

update KPI set value= ? where code=123

and hit 'Parameters'

('?' should be the placeholder for your GVar)




Reply With Quote
  #4  
Old   
Davide
 
Posts: n/a

Default Re: Output vars - 07-10-2006 , 09:05 AM



Hello Philippe,

Quote:
This problem is fixed :-)
But (there's always a but)
Whe I do this, the default value 0 which I specified in the glmobal
variables is written into the table instead of the variable value.

The SQL statement which gets the number out of the table works because
I tested it with Query Analyser. Is there a way to check this or what
am I doing wrong?

"Davide" wrote:

Hello Philippe,

Hi,

I've got a SQL taks in DTS 2000 and a global var with a float
number. I try to get the value of the parameter in the SQL task:

declare @Total float
update KPI set value=@Total where code=123
When I hit "Parameters" to map the variable, I get a message: Query
does not contain any parameters.
How can I fix this?
thanks
Try simply this script :

update KPI set value= ? where code=123

and hit 'Parameters'

('?' should be the placeholder for your GVar)

I've some problems to understand:

You set the value of the GVar using a query, and then you update a table
with the value of this Gvar ?
Before updating the table you should test the value of your Gvar, using an
ActiveX script for example...




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.