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
 SQL Server Development (2000)
 Pass-Through Queries

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-01 : 00:20:50
Philip Hoang writes "Hi,

How can I pass an variable into the OPENQUERY's query?

For example:
SELECT * FROM OPENQUERY(SUN01,'select * from holidays')

SUN01 is the Oracle database running on Unix.
This will work.

But I can not do the following:

Set @t = "select * from holidays"
SELECT * FROM OPENQUERY(SUN01,@t)

Is there any other way to do it?

Thanks
Philip"
   

- Advertisement -