Skip to content

SQL Server: use new JSON type when the compatibility level is set to 170 #36372

@roji

Description

@roji

Azure SQL has introduced a new JSON data type; this replaces the previous JSON support, which used nvarchar(*) to represent JSON documents (SQL Server 2025 - still in preview - introduces the same support). While EF already includes support for the new JSON type, it is opt-in only at this point.

As decided in our design meeting, make EF use the new JSON data type when the compatibility type is set to 170 and above. Note that EF 10 changed the default compatibility level to 170 when using UseAzureSql (#36219); as a result, this is an impactful change for users of UseAzureSql (a migration would be generated for upgrading from nvarchar(x) to json). Document this in the breaking changes notes.

For people using UseSqlServer, they'd have to explicitly opt into using 170 in order to get the new type by default.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions