Coffeehouse Post

Single Post Permalink

View Thread: SQL Server 2016 and JSON support
  • User profile image

    For now, your best bet is to write a little CLR UDF that wraps NewtonSoft.JSON 

    i thought about that , but as i am getting the hang of how to use the support functions  i am finding that i can get it with the built in functions.

    json_value() , json_query()   openjson() and "with (  name type 'path')"

    are working very well for me now...

    also use of [key] =  is abit of a trick to learn,some places it's easy others not so much.

    if you have  a collection  of objects [key] can be used to pick the row you need, if you have an object [key] can select the "column" that looks like a row in sql.

    and you can combine queries so that openjson , select value  becomes the input to an outer openjson()  query.

    so  i now have a query that returns a set of rows that makes one call to fetch the json data and uses nested calls to pick out which member object of which collection.