using Data.ft_Plot

Discussion created by akenyon on May 27, 2014
Latest reply on May 29, 2014 by akenyon

In PI SQL Commander I can query the Data.ft_Plot table with the following query:

SELECT * FROM [PIAFOLEDB].[GasOperations].[Data].[ft_Plot]
WHERE ElementAttributeID ='00000000-0000-0000-99b7-000000000000'
AND StartTime = '05-20-2014'
AND EndTime = '05-27-2014'
AND IntervalCount = 100

 The problem is when I query the table as a linked server using Microsoft SQL Server Management Studio. I use the exact same query and I get the following error.

OLE DB provider "PIOLEDBENT" for linked server "PIAFOLEDB" returned message "[GasOperations.Data.ft_Plot Tbl1002 function table] 'ElementAttributeID', 'StartTime', 'EndTime', 'IntervalCount' argument columns are not restricted or are not restricted properly.

Possible reasons:
- Invalid WHERE condition (use 'ElementAttributeID = ... AND StartTime = ... AND EndTime = ... AND IntervalCount = ...')
- Join order (reorder tables in FROM clause and use 'OPTION (FORCE ORDER)' query hint)".

 I'm not sure if this is a syntax error when switching from PI SQL Commander to SSMS or if there is some configuration I need to adjust on the Linked Server.