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 converting data type nvarchar to decimal." when serializing with 5 or more leading zeros as 1e-5 #1133

Open
cadcad-sat opened this issue Oct 24, 2024 · 0 comments

Comments

@cadcad-sat
Copy link

  • Azure Functions SQL Extension or Extension Bundle Version:

    • Core Tools Version: 4.0.6517
    • RuntimeVersion: 4.1036.1.23224
    • Worker.Extensions.Sql: 3.0.534
  • Is this a deployed or local function:
    local function

  • What type of Database are you using? (Run SELECT @@VERSION as Version, SERVERPROPERTY('EngineEdition') as EngineEdition on your database)

Version EngineEdition
Microsoft SQL Server 2022 (RTM-CU15-GDR) (KB5046059) - 16.0.4150.1 (X64)
Sep 25 2024 17:34:41
Copyright (C) 2022 Microsoft
Corporation
Developer Edition (64-bit) on Linux (Ubuntu 22.04.5 LTS)
3

BUG

I encountered an error while attempting to add a decimal value as an output binding. The error message is as follows:

Exception executing query. Message=Error converting data type nvarchar to decimal.

Upon investigation, I discovered that the error occurs when the decimal value contains five or more leading zeros, such as 0.00001.
I suspect that this issue arises because the decimal value is serialized as 1e-5 in JSON, which then fails to parse correctly in SQL Server.

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

1 participant