public inbox for [email protected]
help / color / mirror / Atom feedSSMS ODBC Linked Server Issue
2+ messages / 2 participants
[nested] [flat]
* SSMS ODBC Linked Server Issue
@ 2021-08-17 18:36 Dulanic <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Dulanic @ 2021-08-17 18:36 UTC (permalink / raw)
To: [email protected]
Hello,
I have reviewed a few different examples of SQL Server/Postgres ODBC linked
server connections. I have gotten some to work, but some tables refuse.
This is the query I am attempting to run and the methods I have tried so
far.
select *
from POSTGRES.teslamate.[public].addresses
and
select * from openquery(POSTGRES,'
select *
from public.addresses
')
but both error out /w this error:
Msg 7356, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "POSTGRES" supplied
inconsistent metadata for a column. The column "display_name" (compile-time
ordinal 2) of object "
select *
from public.addresses
" was reported to have a "LENGTH" of 512 at compile time and 174 at run
time. It seems like it is saying it's a 512 length field, and it is. It is
a character varying(512). However, when the query runs, it comes back
saying it's a 174 length field which is the current max length. These are
the settings I am using for ODBC, though I have tried every
possible variation of these that I could find to solve.
These are my options in SSMS:
https://dulanic.com/img/ssms.png
These are my options in ODBC.
https://dulanic.com/img/odbc.png
https://dulanic.com/img/odbc1.png
https://dulanic.com/img/odbc2.png
^ permalink raw reply [nested|flat] 2+ messages in thread
* RE: SSMS ODBC Linked Server Issue
@ 2021-08-17 18:48 David Parenteau <[email protected]>
parent: Dulanic <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: David Parenteau @ 2021-08-17 18:48 UTC (permalink / raw)
To: Dulanic <[email protected]>; [email protected] <[email protected]>
Maybe you could try replacing the start with casted enumerated list of columns.
For my part, calling PGSQL directly from SQL SSMS was also unstable so we now use to call our PGSQL code using powershell script and using the same ODBC. For now, we have not encountered unstable issues like in SSMS!
Good luck
David Parenteau
From: Dulanic <[email protected]>
Sent: August 17, 2021 14:36
To: [email protected]
Subject: SSMS ODBC Linked Server Issue
Hello,
I have reviewed a few different examples of SQL Server/Postgres ODBC linked server connections. I have gotten some to work, but some tables refuse. This is the query I am attempting to run and the methods I have tried so far.
select *
from POSTGRES.teslamate.[public].addresses
and
select * from openquery(POSTGRES,'
select *
from public.addresses
')
but both error out /w this error:
Msg 7356, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "POSTGRES" supplied inconsistent metadata for a column. The column "display_name" (compile-time ordinal 2) of object "
select *
from public.addresses
" was reported to have a "LENGTH" of 512 at compile time and 174 at run time. It seems like it is saying it's a 512 length field, and it is. It is a character varying(512). However, when the query runs, it comes back saying it's a 174 length field which is the current max length. These are the settings I am using for ODBC, though I have tried every possible variation of these that I could find to solve.
These are my options in SSMS:
https://dulanic.com/img/ssms.png
These are my options in ODBC.
https://dulanic.com/img/odbc.png
https://dulanic.com/img/odbc1.png
https://dulanic.com/img/odbc2.png
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2021-08-17 18:48 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 18:36 SSMS ODBC Linked Server Issue Dulanic <[email protected]>
2021-08-17 18:48 ` David Parenteau <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox