Linked servers enable the SQL Server Database Engine and Azure SQL Managed Instance to read data from the remote data sources and execute commands against the remote database servers (for example, OLE DB data sources) outside of the instance of SQL Server. Typically linked servers are ...
SQLRETURN SQLLinkedServers( SQLHSTMT hstmt) 参数 hstmt ODBC 语句句柄。 返回值 SUCCEED 或 FAIL。 注释 SQL Server 链接服务器为分布式查询中可以使用由四部分组成的名称引用的 OLE DB 数据源。SQLLinkedServers 返回将数据源定义为结果集的属性。可使用 sp_addlinkedserver 系统存储过程向 SQL Server 定义链接...
LINKEDSERVERS 行集用于枚举可以参与 SQL Server 分布式查询的组织数据源。 LINKEDSERVERS 行集包含以下列 。 列名称类型指示符说明 SVR_NAMEDBTYPE_WSTR链接服务器的名称。 SVR_PRODUCTDBTYPE_WSTR标识由链接服务器的名称所表示的数据存储的类型的制造商或其他名称。
SRV_NAME sysname Name of the linked server. SRV_PROVIDERNAME nvarchar(128) Friendly name of the OLE DB provider managing access to the specified linked server. SRV_PRODUCT nvarchar(128) Product name of the linked server. SRV_DATASOURCE nvarchar(4000) OLE DB data source property cor...
This article shows how to create a linked server and access data from another SQL Server, an Azure SQL Managed Instance, or another data source by using SQL Server Management Studio (SSMS) or Transact-SQL. Linked servers enable the SQL Server database engine and Azure SQL Managed Instance to...
Transact-SQL syntax conventions Syntax syntaxsql sp_linkedservers[ ; ] Arguments None. Return code values 0(success) or a nonzero number (failure). Result set Column nameData typeDescription SRV_NAMEsysnameName of the linked server. SRV_PROVIDERNAMEnvarchar(128)Friendly name of the OLE DB provid...
SQL Server Management Studio Transact-SQL Using SQL Server Management StudioTo create a linked server to another instance of SQL Server Using SQL Server Management StudioIn SQL Server Management Studio, open Object Explorer, expand Server Objects, right-click Linked Servers, and then click New ...
s.LinkedServers.Add ls s.Close End Sub 查询Excel 链接服务器 将Excel 数据源配置为链接服务器之后,您可以方便地通过“查询分析器”或其他客户端应用程序查询其数据。例如,为了检索存储在 Excel 文件 Sheet1 中的数据行,以下代码使用了您使用 SQL-DMO 配置的链接服务器: ...
s.LinkedServers.Add ls s.CloseEnd Sub 查询Excel 链接服务器 将Excel 数据源配置为链接服务器之后,您可以方便地通过“查询分析器”或其他客户端应用程序查询其数据。例如,为了检索存储在 Excel 文件 Sheet1 中的数据行,以下代码使用了您使用 SQL-DMO 配置的链接服务器: SELECT * FROM XLTEST_DMO.....
Creating Linked Servers (SQL Server Database Engine) Configuring Remote Servers SQL Mail Database Mail SQL Server Agent Mail Setting Server Configuration Options Using Warm Standby Servers Managing Metadata When Making a Database Available on Another Server InstanceLearn...