Configure the OLE DB Provider as a Linked Server Automatically

Before you begin

Configure a linked server and options using Enterprise Manager, as described in Configuring the Historian OLE DB provider as a Linked Server. Then, since the options Allow In Process and Level Zero Only apply to all linked servers that use the provider, you can create additional linked server definitions to other Historian servers using the sp_addlinkedserver stored procedure.

About this task

This topic describes how to configure the OLE DB provider as a linked server automatically using the sp_addlinkedserver system stored procedure from Microsoft SQL Server. You can also configure it manually.

Procedure

  1. To configure a linked server definition, use the following example code:
    EXEC sp_addlinkedserver @server='MYSERVER_LS', @srvproduct='', 
    @provider='iHOLEDB.iHistorian.1', @datasrc='MY_SERVER'
  2. To search for linked server definitions, use the following example code:
    EXEC sp_linkedservers
  3. To delete linked server definitions, use the following example code:
    EXEC sp_dropserver 'MYSERVER_LS', 'droplogins'