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
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.
Tentatively assigning to myself as for 10.
The text was updated successfully, but these errors were encountered:
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.
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:
nvarchar(4000)
by default, so it's impossible to have larger strings (SQL Server: Support large JSON string properties (>4000) #29477). It's likely that with RETURNING we'd be able to just read out annvarchar(max)
(TBC).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.
Tentatively assigning to myself as for 10.
The text was updated successfully, but these errors were encountered: