One day I was trying to query Oracle data through a SQL Server Linked Server and received the following error:
Msg 7354, Level 16, State 1, Line 1 The OLE DB provider "OraOLEDB.Oracle" for linked server "CEGIS" supplied invalid metadata for column "SHAPE". The data type is not supported.
The error shows it cannot support the column name SHAPE, but the query is not even selecting that column! In case you are wondering, SHAPE has a datatype of ST_Geometry which allows you to store spatial data such as location of a landmark, a street or a parcel of land.
A way to get around this mystery is to use OPENQUERY. Using this syntax, the query comes back correctly.
Now I need to figure out why the original query was trying to use the column SHAPE when it was not mentioned in the query, but that will be another post.
For more information on Linked Servers, the following links are very helpful:
For more information on how I created the Linked Server to Oracle, please read my blog post here: Linked Server that connects to Oracle