Reading from JSON

  • Hi Experts,

    We have a column which stores JSON , how can I query a single property in that column(ex:property:car)

    Thanks

  • VastSQL (8/1/2016)


    Hi Experts,

    We have a column which stores JSON , how can I query a single property in that column(ex:property:car)

    Thanks

    Quick suggestion, post some sample data, the expected output and what you have tried so far.

    😎

  • Here's probably the best option for versions 2014 or lower: https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql-server/

    Although, my suggestions would be to stop storing JSON in SQL Server and normalize the data.

    In SQL Server 2016 there's a native method to consume JSON. It will still be slower to consume compared to querying normalized data.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply