0
votes

How to insert a json value to a column for each row of data in SQL? The Json is formed by the combination of the column values of each row enter image description here

I want to insert a JSON string like to the column 'JSONDoc'

({"PartitionKey":"A","SourceType":"MDD","SourceKey":"DA44DF8B-57C2-46C1-B1A2-92EF0620DB10$7AA49B70-9001-4412-B263-1342DAF215E7","OrganizationOwningAttID":260029,"OrganizationGUID":"DA44DF8B-57C2-46C1-B1A2-92EF0620DB10","OrganizationID":380417,"OrganizationName":"abc"})

which is combination of the values in the table for each row

1) Please update the tags of the question with the RDBMS you are using. JSON functionality varies widely across products. 2) Please share sample data and desired results. Your one sentence explanation of how your json data looks and how the table is set up is not clear enough to be able to answer. - JNevill
OPENJSON and a JOIN? - Larnu