简体   繁体   English

SQL 服务器查询 Delphi 加入链接服务器上的表

[英]SQL Server query in Delphi joining a table on a linked server

I have a SQL Server database that was recently moved to Azure. I have created a linked server in the local SQL Server to the Azure database.我有一个SQL Server的数据库,最近搬到了Azure。我在本地的SQL Server中创建了一个链接服务器到Azure的数据库。 I can run the query in SQL Server Management Studio and it returns the the data I am expecting.我可以在 SQL Server Management Studio 中运行查询,它返回我期望的数据。 When I run this query in my Delphi app I get an error.当我在我的 Delphi 应用程序中运行此查询时,出现错误。

Error: Reference to database and/or server name '...' is not supported in this version of SQL server.错误:此版本的 SQL 服务器不支持对数据库和/或服务器名称“...”的引用。

Example of the query I am trying to run.我尝试运行的查询示例。

Select t1.field1, t2.field2 
from <linkedserver>.<database>.<dbo>.<table1> t1
join <localserver>.<database>.<dbo>.<table2> t2 on t2.id = t1.id

you must use Native Client for Provider connection type.您必须使用 Native Client 作为 Provider 连接类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM