mssql-docker icon indicating copy to clipboard operation
mssql-docker copied to clipboard

JSON data type is missing?

Open Carmageddon opened this issue 1 year ago • 5 comments

I am testing locally using mcr.microsoft.com/mssql/server:2022-latest docker image, and the database works except, apparently the JSON data type is missing.

Image

The screenshot is taken from SSMS 20.2

According to the documentation of SQL Server, its supposed to be available.

When I try to explicitly type "JSON" as the desired data type, I get error "Invalid data type"

The exact version, from the docker logs:

2025-01-09 20:00:00 13:32:15.84 Server Microsoft SQL Server 2022 (RTM-CU16) (KB5048033) - 16.0.4165.4 (X64) 2025-01-10 09:32:15 Nov 6 2024 19:24:49 2025-01-10 09:32:15 Copyright (C) 2022 Microsoft Corporation 2025-01-10 09:32:15 Developer Edition (64-bit) on Linux (Ubuntu 22.04.5 LTS) <X64>

Carmageddon avatar Jan 16 '25 16:01 Carmageddon

Thanks @Carmageddon. The JSON data type is only currently available in the Azure SQL Platform as a Service offerings such as Azure SQL Database and Azure SQL Managed Instance. Unfortunately, it is not available for SQL Server 2022.

thesqlsith avatar Jan 16 '25 16:01 thesqlsith

Thank you @thesqlsith ! I believe I have found the correct image: https://hub.docker.com/r/microsoft/azure-sql-edge and tried using it instead - but running into the same issue.. I realize this is no longer strictly related to this specific repo and the issue should be closed, but just checking in case you are familiar and know why its not working on it either?

Carmageddon avatar Jan 17 '25 14:01 Carmageddon

No problem. Thank you for raising this @Carmageddon

The reason Azure SQL Edge is also not working is that it is not part of an Azure Platform as a Service (Paas) set of service offerings. These offerings include services like Azure SQL Database (including Hyperscale) and Azure SQL Managed Instance. SQL Edge is much closer to SQL Server than Azure SQL Database. You can think of it as a lightweight version of SQL Server, like something like SQL Server Express, with a few more limitations despite the product having Azure in its name.

Unfortunately, we will be retiring the Azure SQL Edge product later this year and as such, it will not be receiving the new JSON data type support.

While I am not in marketing, I would add that we do have a free Azure SQL Database offering if you would like to test out the JSON datatype support there.

thesqlsith avatar Jan 17 '25 15:01 thesqlsith

Thanks @thesqlsith , I'll look into that. But what if I wanted to work offline locally in a local dev env? How is the Azure SQL DB conductive to a full local dev env?

Carmageddon avatar Jan 17 '25 16:01 Carmageddon

I ran into the same issue as @Carmageddon. Any solution on how we can run a docker image locally for Azure SQL?

My solution was to use nvarchar(max) or nvarchar(4000).

Let me know if you found a better one!

MykeVFX avatar Feb 17 '25 11:02 MykeVFX