SQL JSON - How to modify boolean value present in the Json Data

Viewed 11833

How can I modify the existing boolean value of a json data in SQL Server 2016 - Json?

Below is the script for inserting json Data.

DECLARE @a nvarchar(max) = N'{"employeeName":"Test","isActive":true}';

insert into TestTable(testId,name,jsonData) Values('1','Test',@a) 

I tried to update using below query, but it returns Invalid column name 'false'.

update TestTable
set jsonData = JSON_MODIFY(jsonData,'$.isActive',false)
1 Answers
Related