Use the four-part naming convention
- Last UpdatedMar 19, 2025
- 2 minute read
The linked server name is simply a name by which the AVEVA Historian OLE DB provider is known to the Microsoft SQL Server. In order for a query to be passed on to the AVEVA Historian OLE DB provider, you must specify the linked server name and the extension table name as part of a four-part naming convention.
For example, this query specifies to retrieve data from the History extension table in the AVEVA Historian OLE DB provider:
SELECT * FROM INSQL.Runtime.dbo.History
WHERE TagName = 'SysTimeSec'
AND DateTime >= '2001-09-12 12:59:00'
AND DateTime <= '2001-09-12 13:00:00'
The four-part naming convention is described in the following table:
|
Part Name |
Description |
|---|---|
|
linked_server |
Linked server name. By default, INSQL. |
|
catalog |
Catalog in the OLE DB data source that contains the object from which you want to retrieve data. For Microsoft SQL Server type databases, this is the name of the database. To use the AVEVA Historian OLE DB provider, the catalog name will always be "Runtime." |
|
schema |
Schema in the catalog that contains the object. For Microsoft SQL Server type databases, this is the name of the login ID for accessing the data. To use the AVEVA Historian OLE DB provider, the catalog name will always be "dbo." |
|
object_name |
Data object that the OLE DB provider can expose as a rowset. For the AVEVA Historian OLE DB provider, the object name is the name of the remote table that contains the data you want to retrieve. For example, the History table. |
In the case of four-part queries, SQL Server produces the statement that is sent to the AVEVA Historian OLE DB provider from the statement that the user executes. Sometimes this produced statement is incorrect, too complex, or lacks portions of the WHERE clause required for the AVEVA Historian OLE DB provider to return data.
A typical error message when executing unsupported syntax is:
Server: Msg 7320, Level 16, State 2, Line 1
Could not execute query against OLE DB provider 'INSQL'.
[OLE/DB provider returned message: InSQL did not receive a WHERE clause from SQL Server. If one was specified, refer to the InSQL OLE DB documentation]
For four-part queries against non-English SQL Servers running on non-English operating systems, the default date format might differ from the English versions. For example, for a French or German SQL Server running on the corresponding operating system, the date/time in a four-part query must be:
yyyy-dd-mm hh:mm:ss.fff
For example:
2003-28-09 09:00:00.000
The default SQL date format is dependent on SQL Server and not on the operating system used. However, you can modify the format using the SQL Server Convert() method. The output of this method can be determined by the regional settings configured for the operating system.