sql server - Replacing JSON Formatted String in SQL -


i have in table column:

{"inputdirection":0,"mask":"aa","formatstring":null,"autocompletevalue":null,  "filtered":"0123456789","autocomplete":false,"readonly":true} 

what want change n in "mask":"aa" , remove "filtered":"0123456789" if exist. mask in different forms a9a, 'aaaa`, etc.

if in c# myself parsing json, etc need within sql.

i've found article shows how parse json table. gave me idea can parse each field temp table , make changes on , convert json update actual field take json field from. however, looks cumbersome process both me , server.

any better ideas?

you can use link .

and use following code

select * #demo (select * parsejson('{"inputdirection":0,"mask":"aa","formatstring":null,"autocompletevalue":null,  "filtered":"0123456789","autocomplete":false,"readonly":true}  '))  select * #demo  --- change data here required   declare @myhierarchy jsonhierarchy; insert @myhierarchy select * #demo;   -- use value , update json column select dbo.tojson(@myhierarchy)   drop table #demo 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -