0

I have JSON definitions in a SQL table, from there I am trying to parse it into a SQL Server view or a table (anything would be helpful).

LookupJSON table has a single column called definition_JSON and an example of one value looks like this:

{"__type":"userTask","name":"Grade Report","id":4,"directApprove":false,"emailNotification":{"body":"<p>Hi, your Form was successfully submitted! <\/p>","emailType":2,"subject":"Form Submitted"},"lock":false,"submitBool":true, "submitBtn":"Submit"}

I just need to get the name, userTask and id as results.

When we tried the following query it didn't like that nested query, it is expecting JSON.

Select * 
From parseJSON (select top 1 * from LookupJSON)

We are using SQL Server 2012.

9
  • 1
    Title say 2012, tags say 2008, and content say 2012 R2 (that doesn't even exists). Are you sure you are not using postdbcle sql? Commented Mar 6, 2018 at 18:14
  • @ZoharPeled: synchronized everything to "SQL Server 2012" - assuming that's what he's actually using :-)
    – marc_s
    Commented Mar 6, 2018 at 18:23
  • SQL Server 2012
    – Nestalna
    Commented Mar 6, 2018 at 18:32
  • @ZoharPeled how is this a duplicate? Please link the "original"?
    – Nestalna
    Commented Mar 8, 2018 at 16:36
  • You need to get values from a json string. Link to the original is on the top of your question, bolded in yellow. Commented Mar 8, 2018 at 17:23

0

Browse other questions tagged or ask your own question.