dbTalk Databases Forums  

Using Global Variables in SQL Task

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


Discuss Using Global Variables in SQL Task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tabladude@gmail.com
 
Posts: n/a

Default Using Global Variables in SQL Task - 04-12-2005 , 06:19 PM






Hello:

I'm trying to use a parameter in an SQL Task. The task's data
connection is just to the local SQL Server. It should be simple enough:

DELETE FROM dTable WHERE DATEDIFF(d,[Timestamp],getdate()) < ?

However, when I click on the "Parameters" button I get an error:

"Invalid Parameter Number"

followed by:

"An error occurred while parsing the SQL Statement for parameters.
Please check the syntax of the SQL statement and verify that it is
valid for the connection selected"

The SQL Statement is correct, and works fine if I hardcode a number
into the parameter. I am trying to use a global variable of type
"integer" that I have created in the package's global variables
section.

Any ideas?

Thanks,
Kayda


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

Default Re: Using Global Variables in SQL Task - 04-13-2005 , 12:39 AM






This works fine for me.

Make sure the connection to which the task is pointing is SQL Server.





"tabladude (AT) gmail (DOT) com" <tabladude (AT) gmail (DOT) com> wrote


Quote:
Hello:

I'm trying to use a parameter in an SQL Task. The task's data
connection is just to the local SQL Server. It should be simple enough:

DELETE FROM dTable WHERE DATEDIFF(d,[Timestamp],getdate()) < ?

However, when I click on the "Parameters" button I get an error:

"Invalid Parameter Number"

followed by:

"An error occurred while parsing the SQL Statement for parameters.
Please check the syntax of the SQL statement and verify that it is
valid for the connection selected"

The SQL Statement is correct, and works fine if I hardcode a number
into the parameter. I am trying to use a global variable of type
"integer" that I have created in the package's global variables
section.

Any ideas?

Thanks,
Kayda


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.