You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support the new RETURNING clause in JSON_VALUE() in the upcoming SQL Server 2025 #35729
In SQL Server 2025 (and an upcoming update of Azure SQL), the JSON_VALUE() function will be improved to support a RETURNING clause, allowing specifying the data type coming out of the JSON property. We currently wrap JSON_VALUE() in a CAST, but this has several issues:
CAST applies generic string casting without taking into account that the property comes from JSON. While the standard way to represent binary data in JSON is base64 encoding, SQL Server CAST attempts to parse out SQL Server's native format, which fails.
The additional CAST may reduce performance compared to the native RETURNING feature of JSON_VALUE.
Note that JSON_VALUE() and the RETURNING clause is part of the ANSI SQL standard, and is already supported in PostgreSQL 17 (EFCore.PG tracking issue). So we should implement all this as the default behavior in relational, and override to implement the old behavior without RETURNING.
Note: implemented for PostgreSQL in npgsql/efcore.pg#3490, without any relational support for now; when the SQL Server support is available, I'll compare and see what's common etc.
Activity
roji commentedon Mar 6, 2025
Note: implemented for PostgreSQL in npgsql/efcore.pg#3490, without any relational support for now; when the SQL Server support is available, I'll compare and see what's common etc.
Use SQL Server 2025 JSON_VALUE() RETURNING clause
Use SQL Server 2025 JSON_VALUE() RETURNING clause
Use SQL Server 2025 JSON_VALUE() RETURNING clause
Use SQL Server 2025 JSON_VALUE() RETURNING clause
Use SQL Server 2025 JSON_VALUE() RETURNING clause (#36456)