Parse JSON string in sql

I have a column of JSON strings in my table, I'm using SQL Server 2008. Any ideas on how to parse a JSON string and retrieve a specific value?

Here is my JSON string:

{"id":1234,"name":"Lasagne al frono","description":"Placerat nisi turpis, dictumst nasceture ete etiam mus nec cum platea tempori zillest. Nisi niglue, augue adipiscing ete dignissim sed mauris augue, eros!","image":"images/EmptyProduct.jpg","cartImage":"images/ArabianCoffee.jpg","basePrice":54.99,"priceAttribute":"itemPrice","attributes":[{"type":"Addons","label":"Side","attributeName":"Side","display":"Small","lookupId":8},{"type":"Addons","label":"Drink","attributeName":"drink","display":"Small","lookupId":5},{"label":"add note","type":"Text","attributeName":"notes","display":"Wide","lookupId":null}]} 

Do I need to extract the value "name", "Any help"?

+4
source share
3 answers

Since the sql server does not support native JSON support, you will need to parse this manually, which will get complicated.

However, you can always use someone else's JSON parsing library .

+8
source

For parsing JSON, you can write a lightweight CLR in C # or VB.NET.

+2
source
0
source

All Articles