I have a table with 3 columns:
id INT, name NVARCHAR(50), myData NVARCHAR(MAX)
myData just holds a json string array something like
["Fingers"]
["Fingers","Right-"]
["Arm","Fingers","Left-"]
I want to select all the values in 1 column, such as
Fingers
Fingers
Right-
Arm
Fingers
Left-
How can I go about this? I do not believe SQL Server 2014 can read JSON data.
Once this is done, I can select each unique value by doing a SELECT DISTINCT statement.
I need to be able to do this with T-SQL, and cannot create any functions to cope with this, must be T-SQL only.
Any help much appreciated.
[ { "Array": [ {"value":"Fingers"}, {"value":[{"value":"Fingers"},{"value":"Right-"}]}, {"value":[{"value":"Arm"},{"value":"Fingers"},{"value":"Left-"}]} ] } ]. OPENJSON perfect for your solution for that refer : learn.microsoft.com/en-us/sql/relational-databases/json/… please look at stackoverflow.com/a/37218450/6923146