Thursday, May 2, 2024

Apples are case sensitive, oranges are not

 Amazing discovery of the day: JSON parsing in SQL Server is kind of case sensitive.

More specifically, when you write

select * from openjson(SomeJSON) with (Foo int, Bar varchar(max))

the names Foo and Bar are matched against the JSON in a case sensitive manner. If the JSON contains foo instead, you will get a field called Foo with a uniform null in the recordset.

No comments:

Post a Comment