Character Formats and Sort Orders in Distributed Queries

OLE DB providers accessed from a distributed query can support sort orders different from the local SQL Server’s sort order. However, Microsoft® SQL Server™ always uses the local SQL Server character set and sort order while processing distributed queries, even if the remote data uses a different sort order. For example, consider a distributed query executed in the local server against another SQL Server named SalesSvr:

SELECT s.OrderId, s.OrderDate

FROM SalesSvr.pubs.dbo.Sales s

ORDER BY s.OrderDate

  

SQL Server uses the local sort order and not the sort order of the SalesSvr server in evaluating this ORDER BY query. When accessing data type DBTYPE_STR, SQL Server maps it to char or varchar, and this data is then interpreted in the local SQL Server code page. Therefore, distributed queries can be meaningfully used only against remote data sources that store character data in the same code page as the local SQL Server.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.