JoelBrabant

Calling PIFunction from SQL Server on linked server

Discussion created by JoelBrabant on Apr 10, 2009
Latest reply on Apr 13, 2009 by RJKSolutions

I got it working once but I don't remember what I did...

 

Something to do with calling those PI Functions

 

I simply want to execute a SQL Server statement like this (seen in examples)

SELECT tag 
FROM
mylinkedserver.piarchive..pisnapshot
WHERE tag ='Sinusoid' AND ((DATE('*')- time)
BETWEEN RELDATE('4h')AND RELDATE('365d')OR status <> 0)

in SQL Server Management Studio

 

My PI server has those PI Functions created DATE, DIGSTRING,RELDATE but I can't call them directly like the statement above.

 

Works ok when executed with the PIOLEDBTester but not from my SQL query window...

 

Some help would be greatly appreciated.

 

Thanks

Outcomes