SQL
Is JSON enabled

Azure SQL JSON Compatibility Tests

Use the following three SQL blocks to verify that your Azure SQL instance correctly supports JSON data types and functions.


1. Compatibility Level Check

Check Current Level: Run this query to see what level you are currently on:

SELECT name, compatibility_level 
FROM sys.databases 
WHERE name = DB_NAME();

*** If the number is 120 or lower, JSON functions will fail. Run this to upgrade ***

-- Replace 'YourDatabaseName' with your actual DB name
ALTER DATABASE [YourDatabaseName] SET COMPATIBILITY_LEVEL = 150;

2. How to verify exactly where it's breaking

Run this "stress test" in your Portal's Query Editor. It will tell us if the engine itself is failing or if it's just your specific table/user:

Test 1: Simple JSON parsing

SELECT JSON_VALUE('{"result":"success"}', '$.result') as Test1;

Test 2: Table-valued parsing

SELECT * FROM OPENJSON('{"a":1,"b":2}') as Test2;

*** If Test 1 works but Test 2 fails: You have a permission issue or a very specific driver limitation. ***