vendredi 15 janvier 2016

How to Fix Inconsistent Metadata Error in SQLite -> SQL Server Linked Server w/ ODBC

I'm using a new software deployment program that creates an inventory of all the computers and servers I'm managing as a table in a SQLite database. This software has replaced SCCM, which we used to generate a similar inventory in our SQL Server DB previously. So, after installing this ODBC driver for SQLite, I added the SQLite DB as a linked server.

Now, when I try to access any tables in that DB, I get this error:

The OLE DB provider "MSDASQL" for linked server "SQLite DB" supplied inconsistent metadata for a column. The column "example" (compile-time ordinal 13) of object "select * from sqlite_table" was reported to have a "DBTYPE" of 130 at compile time and 3 at run time.

The query I'm using to attempt to pull the data is:

Select *
from openquery(SQLite DB , 'select * from sqlite_table')
GO

I've searched this everywhere, and I see examples of similar errors when trying to pull data from Progress or older versions of SQL Server, but the solution always seems to be using openquery, which those users aren't. We only get the error when using openquery, and trying to access without it returns invalid object names or incorrect four-part name errors.

Aucun commentaire:

Enregistrer un commentaire