PRB: SQL Distributed Query with MSIDXS Provider Needs Additional Quotes (220598)
The information in this article applies to:
- Microsoft SQL Server 7.0
- Microsoft OLE DB Provider for Index Server 2.0
This article was previously published under Q220598 SYMPTOMS
Performing the following distributed query with SQL Server 7.0 and Index Server 2.0 OLE DB Provider
SELECT a.*
FROM OpenRowset('MSIDXS','Web';''; '', 'Select Directory, FileName, size, Create, Write
from SCOPE()
where CONTAINS(' ' "Index Server" NEAR() "SQL Server" ' ')> 0
and FileName LIKE ''%.htm%'' ') as a
gives an error similar to the following:
Server: Msg 170, Level 15, State 1, Line 4
Line 4: Incorrect syntax near ' "Index Server" NEAR() "SQL Server" '.
CAUSE
There is an additional space character between the two single quotation mark characters inside the CONTAINS clause.
RESOLUTION
Remove any additional space characters between the two single quotation mark characters inside the CONTAINS clause. For example:
SELECT a.*
FROM OpenRowset('MSIDXS','Web';''; '', 'Select Directory, FileName, size, Create, Write
from SCOPE()
where CONTAINS('' "Index Server" NEAR() "SQL Server" '')> 0
and FileName LIKE ''%.htm%'' ') AS a
STATUS
This feature is by design.
REFERENCES
For more details on setting up and using distributed queries, search on sp_addlinkedserver, OpenQuery, OpenRowset, and related topics in SQL 7.0 Books Online.
For a discussion on OLEDB provider configuration for distributed queries, refer to the following topic in SQL 7.0 Books Online,
"Configuring OLE DB Providers for Distributed Queries."
For more information on Index Server, refer to Index Server documentation
in the Windows NT 4.0 Option Pack documentation.
For additional information about how to use the "NEAR" keyword for proximity searches, please see the following
article in the Microsoft Knowledge Base:
198493 INFO: Using NEAR in SQL Full-Text and MSIDXS Distributed Queries
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | kbDatabase kbprb KB220598 |
---|
|