I have a column of JSON strings in my table, I’m using SQL Server 2008.
Any Ideas on how to parse the JSON string and extract a specific value?
Here’s 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}]}
I need to extract the value of “name”, Any Help?
Since sql server has no JSON support built in, you’d need to parse this manually, which would get complicated.
However, you could always use somebody else’s JSON parsing library.