Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
travisas opened this issue Aug 1, 2017 · 8 comments

Comments

@travisas
Copy link

travisas commented Aug 1, 2017

We recieve this error when trying to access MYSQL Link table via FDW from Postgres. Couldnt find on the web what level: 16 references. Any help would be appreciated.

Thank you
Travis

@juliogonzalez
Copy link
Member

Hi @travisas,

Could you share with us more details, such as tds_fdw version, freetds config, table(s) structure(s) at both MSSQL and PostgreSQL, and the query that provokes the issue?

@travisas
Copy link
Author

travisas commented Aug 1, 2017

Information Below. I have three screen captures to share. how can I do that?

Postgres version 9.6

Microsoft SQL Server 2008 (SP3) - 10.0.5538.0 (X64) Apr 3 2015 14:50:02 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.0 (Build 6002: Service Pack 2)

------------------------- Process being used

As mentioned below, If the views are pointing to different server( with linked server) we are not able to retrieve the data from SQL Server. Please find the below steps which we performed for executing the task.

  1.   Connecting to Dev Server, IMASCDB.
    
  2.   Please find the below screenshot for  View Definition for [META].[MEASURE_TYPE]
    
  3.   Please find the below screen shot for Data Types of  Meta.Measure_Type
    
  4.   We are able to create Foreign Table for the view.
    
  5.   When we are trying to execute the query it is throwing below error.
    

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

@travisas
Copy link
Author

travisas commented Aug 1, 2017

Free TDS version: freetds-0.95.81

Global settings are overridden by those in a database

server specific section

[global]
# TDS protocol version
; tds version = 4.2

    # Whether to write a TDSDUMP file for diagnostic purposes
    # (setting this to /tmp is insecure on a multi-user system)

; dump file = /tmp/freetds.log
; debug flags = 0xffff

    # Command and connection timeouts

; timeout = 10
; connect timeout = 10

    # If you get out-of-memory errors, it may mean that your client
    # is trying to allocate a huge buffer for a TEXT field.
    # Try setting 'text size' to a more reasonable limit
    text size = 64512

A typical Sybase server

@travisas
Copy link
Author

travisas commented Aug 1, 2017

dataddl_mysql
dataddl_postgres
queryanderror
remotelinkobject

@travisas
Copy link
Author

travisas commented Aug 2, 2017

Any help would be appreciated.. let me know if you have any questions about the uploaded images.

Postgres fdw -> mysql link table -> mysql static table

is what we are trying to do here.

@ilkosta
Copy link

ilkosta commented Oct 31, 2017

same problem and seem same use-case:

pg (fdw) -> mssql (linked server) -> mssql

@pembo13
Copy link

pembo13 commented Sep 7, 2018

Seeing this when I try to update a materialized view

DB-Library error: DB #: 20004, DB Msg: Read from the server failed, OS #: 4, OS Msg: Interrupted system call, Level: 9

@julqui
Copy link

julqui commented Jul 29, 2021

modificar la base de datos SQLSERVER a:

ALTER DATABASE [...]SET ANSI_NULL_DEFAULT ON
ALTER DATABASE [...]SET ANSI_NULLS ON
ALTER DATABASE [...]SET ANSI_warnings ON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants