TDSParser: Encountered unexpected unknown token (0xA3)

馋奶兔 提交于 2020-01-16 08:43:37

问题


When calling some specific stored procedures using mssql-jdbc, I get an jdbc internal error in Java:

Jan 02, 2020 8:11:32 AM com.microsoft.sqlserver.jdbc.TDSParser throwUnexpectedTokenException
SCHWERWIEGEND: ConnectionID:5 ClientConnectionId: 30dcbc6e-ec5c-45ba-8801-1ecc549a0cd4: getNextResult: Encountered unexpected unknown token (0xA3)
Jan 02, 2020 8:11:32 AM com.microsoft.sqlserver.jdbc.TDSReader throwInvalidTDSToken
SCHWERWIEGEND: ConnectionID:5 ClientConnectionId: 30dcbc6e-ec5c-45ba-8801-1ecc549a0cd4 got unexpected value in TDS response at offset:0

It is reproducable for those procedures, here is one I reduced to still throw the error:

PROCEDURE [dbo].[GetAllData]
WITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER 
AS BEGIN ATOMIC WITH ( TRANSACTION ISOLATION LEVEL = SNAPSHOT,  LANGUAGE = N'English')
    SELECT NULL AS testcol
RETURN 0
END

Before I updated to SQL Server 2019 I was using SQL Server 2016, where the procedures worked fine.

I am using:

  • SQL Server 2019 (15.0.2070.41)
  • mssql-jdbc 7.4.0.jre8, 7.4.1.jre8, 8.1.1.jre8-preview
  • AdoptOpenJDK 8u222

I had the same problem in dotnet using the Microsoft.Data.SqlClient which I could "fix" by using the old System.Data.SqlClient library.

来源:https://stackoverflow.com/questions/59559872/tdsparser-encountered-unexpected-unknown-token-0xa3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!