I have sqlite database connected through linked server in sql server. Following query works just fine:
select *
from openquery(
eod,
'select id, min(dt) as mindt, max(dt) as maxdt from [tdata] group by id'
)
But this query returns an error:
select *
from openquery(
eod,
'select COUNT(*) as cnt from [tdata]'
)
Error is:
The OLE DB provider "MSDASQL" for linked server "eod" supplied inconsistent metadata for a column. The column "cnt" (compile-time ordinal 1) of object "select COUNT(*) as cnt from [tdata]" was reported to have a "DBTYPE" of 129 at compile time and 3 at run time.
What could be wrong and how to fix it?