AnsweredAssumed Answered

AF Linked Table Configuration Issue

Question asked by CalebH on Jun 14, 2019
Latest reply on Jun 17, 2019 by CalebH

I am trying to setup a linked SQL table in the AF Library.  My query works correctly in SQL Server Management Studio (compatible with SQL Server 2008 syntax) but when I try to use that in the AF linked table query, I get the following error:

"Unable to link to external table: Unexpected Server Error: 'Deferred prepare could not be completed.
Statement(s) could not be prepared.
Invalid column name 'FieldA'.
Invalid column name 'FieldA'.'.
Use Event Viewer to see the PI AF Server log file for more information."


I don't know what "Event Viewer" it is referring to - I saw nothing related in the Windows Event Viewer Application logs.


The query is similar to:

SELECT Table1.Field1,
WHEN ISNULL(Table2.FieldA,'') = ''
THEN Table2.FieldB + ',' + Table1.Field2

Table2.FieldB + ',' + Table2.FieldA + ',' + Table1.Field2
END AS Field2
FROM Table1
INNER JOIN Table2 ON Table1.IDField = Table2.IDField


Is it not possible to do Joins in AF linked table queries?