Hi @PC238
How about this query?
CREATE TABLE #TEMP(StudentId INT, Agreement VARCHAR(20), StudentName VARCHAR(20))
INSERT INTO #TEMP VALUES
(1,'No','John Doe')
SELECT *,CONCAT('{ "SingleValues": [ { "fieldValue": "'
,Agreement
,'", "fieldName": "Agreement" },{ "fieldValue": "'
,StudentName
,'", "fieldName": "StudentName" } ] }') AS [JSON]
FROM #TEMP ;
Output:
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.