Using pseudo columns with a linked server
If you use four=part SQL when attempting to query a pseudo column, you'll get an error. For example, in this query ROWID
is a pseudo column:
SELECT ROWID, ORDER_ID FROM MYLINKEDSERVER..SYSTEM.ORDERS Msg 207, Level 16, State 1, Line 4 Invalid column name 'ROWID'.
with four-part SQL, you can only query physical columns in a linked server table, not pseudo columns.
To work around this, use the OPENQUERY
function instead. For example:
SELECT * FROM OPENQUERY(MYLINKEDSERVER,'SELECT ROWID, ORDER_ID FROM ORDERS')