Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Global Variables

Author  Topic 

BobFoutFX4
Starting Member

9 Posts

Posted - 2008-03-19 : 17:41:39
Can you use Global Variables in Execute SQL Tasks? I want to set the variable in an ActiveX Script and then use that variable in a sql statement for a WHERE clause. Is this possible?

For example, I want to pull a specific date so I could prompt for the date in an ActiveX script, and then use that date inside a SQL statement to pull that dates results.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-03-20 : 06:05:41
Yes, you can definitely use global variable in Execute SQL task. You can put ? in place of parameters and define input parameters which will be substitued later.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

BobFoutFX4
Starting Member

9 Posts

Posted - 2008-03-20 : 08:45:43
Ok... so how do I reference it in the Execute SQL task?
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-03-20 : 08:49:39
Goto Execute SQL Task's properties, click on Parameters... button. In the "Parameter Mapping" dialog box, define desired input global variable as input parameter.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -