įor more information, see sp_addlinkedserver (Transact-SQL) and Distributed Queries Stored Procedures (Transact-SQL) in the SQL Server documentation. Issue a SELECT query using a four-part name. Use sp_tables_ex to list tables in a folder. EXECUTE sp_addlinkedsrvlogin MyTextLinkedServer, FALSE, Admin, NULL EXECUTE sp_addlinkedserver MyTextLinkedServer, N'Jet 4.0',ĭefine security context. Syntax EXECUTE sp_addlinkedserverĬreate a linked server to a local text file. Also, you can use the OPENROWSET and OPENDATASOURCE row set functions for one-time remote data access without defining the linked server in advance. Īdditionally, you can use the OPENQUERY row set function to explicitly invoke pass-through queries on the remote linked server. You can access linked server data sources from T-SQL using a fully qualified, four-part naming scheme. The OLE-DB data source is the specific data source to be accessed, using the specified OLE-DB provider.ĮXECUTE sp_addlinkedserver to add new server definitions.ĮXECUTE sp_addlinkedserverlogin to define security context.ĮXECUTE sp_linkedservers or SELECT * FROM sys.servers system catalog view to retrieve meta data.ĮXECUTE sp_dropserver to delete a linked server. NET Dynamic Link Library (DLL) that handles the interaction of SQL Server with all data sources of its type. The linked server definition contains the linked server alias, the OLE DB provider, and all the parameters needed to connect to a specific OLE-DB data source. Some sources may allow read only access, others may require specific security context settings, and so on. The available functionality and the specific requirements vary significantly between the various OLE-DB sources. You can configure linked servers using either SQL Server Management Studio, or the system stored procedure sp_addlinkedserver. Querying heterogeneous data source using the familiar T-SQL API. Running distributed queries, data modifications, and transactions for enterprise-wide data sources. Reading external data for import or processing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |