I'm using SQL Server 2008 to fetched data from another server using linked server.
SELECT * FROM OPENQUERY (METER,
'SELECT
ME.Col1
,ME."ext" AS ext
,ME."t-date" AS Date
,ME."per-id" AS Person
,PE."con-id" AS Contact
,PE."add-id" AS Address
,SC."contact-title" AS Member
,SC."given" AS Giver
,SC."surname" AS lastname
FROM PU."member" ME
LEFT JOIN PU."personal" PE
ON ME."per-id" = PE."per-id"
LEFT JOIN PU."cont" SC
ON PE."contactid" = SC."contactid"
WHERE ME."t-date" IS NULL
OR ME."t-date" >= NOW()')
I'm getting error:
OLE DB provider "MSDASQL" for linked server "METER" returned message "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".
Msg 7341, Level 16, State 2, Line 1
Cannot get the current row value of column "[MSDASQL].T_DATE" from OLE DB provider "MSDASQL" for linked server "METER". Conversion failed because the data value overflowed the data type used by the provider.
If I remove where condition and executing this, I'm getting same error as well. So I think "Date" is not causing any issue here. Please Correct me if I'm wrong.
However, if I remove ,SC."contact-title" AS Member from the above query, it gives me result and works fine.
I got information that:
Length of the data in each field must be less than the length described in the schema. For contact-title defined as certain character and data need to be less than that. - I understand this.
My question is in select query I'm trying to fetch the data and I'm not inserting any where. But, still why this character length mismatch ? As per my understanding if I'm inserting it somewhere then there could be a issue. But just select should not give issue.
I'm just fetching data from 3rd party server and displaying. Is there any issue could be at my end/my database? If yes, how?
Could anyone has faced similar issue and how to solve this?
,SC."contact-title"with out the AS Member? - Dr. Stitch