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)
 passing parameter to a linked index server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-30 : 11:17:52
Laurence writes "Hi

In SQL 7.0 I set up a linked server to my Index Server Catalog (called Web)

In the Query Analyser the following line works fine by returning all the filenames of all the files that have the word doctor somewhere in them.

select * from openquery(Web, 'Select filename from SCOPE() where contains(''doctor'') ')

OK so I then did

DECLARE @InString varchar(100)
SET @InString ='doctor'
select * from openquery(Web, 'Select filename from SCOPE() where contains('''' + @InString + '''') ')

Compiles OK but returns the error
An error occurred while preparing a query for execution against OLE DB provider 'MSIDXS'.

I've tried to fix by changing the quotes, using +'s, etc, but I just can't get it to work.

Any suggestions?

Thanks

Laurence"
   

- Advertisement -