Linked SQL Server database giving "inconsistent metadata" error

dpmattingly picture dpmattingly · Jul 24, 2009 · Viewed 41.4k times · Source

I am currently running a third-party software suite, which uses SQL Server as its database. I have a second instance of SQL Server running in a different location, and some apps that I am building in that instance SQL Server needs to access some data in the third-party software. So, I created an ODBC connection between the boxes, and set up the third-party SQL server as a linked server on my version of SQL Server. As a test, I ran something like the following statement from my SQL server, accessing one of the third-party's tables:

SELECT * FROM LinkedServerName.SchemaName.dbo.TableName

To which I recieved this error:

OLE DB error trace [Non-interface error:  Column 'TableRowVersion' (compile-time
ordinal 4) of object '"SchemaName"."dbo"."TableName"' was reported to have a
DBCOLUMNFLAGS_ISROWVER of 0 at compile time and 512 at run time].

Msg 7356, Level 16, State 1, Line 1

OLE DB provider 'MSDASQL' supplied inconsistent metadata for a column. Metadata
information was changed at execution time.

This error is the same for any other table I try to access. What does this error mean, and is there a way around it?

Answer

BrianD picture BrianD · Jul 24, 2009

I've had this happen a few times. The one workaround I found was to use OPENQUERY.

SELECT * FROM OPENQUERY(LinkedServerName, 'SELECT * FROM DBName.Schema.Table')

Also, the select you posted above has an incorrect 4 part name (could just be a typo but I wasn't sure). It should be LinkedServerName.DBName.SchemaName.TableName