tds_fdw icon indicating copy to clipboard operation
tds_fdw copied to clipboard

ERROR: DB-Library error: DB #: 20018 [...] Level: 16,

Open Karlodun opened this issue 7 years ago • 3 comments

ERROR: DB-Library error: DB #: 20018, DB Msg: General SQL Server error: Check messages from the SQL Server, OS #: -1, OS Msg: , Level: 11 or Level: 16 SQL state: HV00L Using tsql I can connect and execute queries. Error reporting (msg_handling) is on 'notice' but does not give me any additional info :-( FreeTDS is the actual one from epel-repository. (if I compile git version, I receive the same error) The tds_fdw is from the 'official' yum.postgresql.org repo (CentOS 7)

Karlodun avatar Aug 17 '17 13:08 Karlodun

I am to get error like this,

SQL Error [HV00L]: ERROR: DB-Library error: DB #: 20018, DB Msg: General SQL Server error: Check messages from the SQL Server, OS #: -1, OS Msg: , Level: 16 Help me please, I try to access MSSQL database from a PostgreSQL database by using FreeTDS and tds_fdw, if I am excute this query "SELECT code FROM public.sap_oitt;" but always I get Error like this

SQL Error [HV00L]: ERROR: DB-Library error: DB #: 20018, DB Msg: General SQL Server error: Check messages from the SQL Server, OS #: -1, OS Msg: , Level: 16

Arief6684 avatar Aug 31 '17 06:08 Arief6684

You need to check the log on the SQL Server to determine what the error is.

AndrewGrossman avatar Oct 06 '17 17:10 AndrewGrossman

I encountered this error as well and found that my foreign table was referencing columns that don't exist. The error disappeared once I got the column names right (do check if you have case sensitive columns as well).

For me, to reproduce:
on SQL Server : create table animal ( id int, name varchar(50) );

and on PG : create foreign table fdw_animal ( id int, zzz varchar(50) ) server myserver OPTIONS(...);

select * from fdw_animal gives the error.

SQL Error [HV00L]: ERROR: DB-Library error: DB #: 20018, DB Msg: General SQL Server error: Check messages from the SQL Server, OS #: -1, OS Msg: , Level: 16

Was unable to locate any logs on the SQL server. Hope this helps.

moopmonster avatar Aug 13 '20 08:08 moopmonster