I am looking to pull some columns (Col1 and 2) of a table and put in JSON format and also write some hardcoded JSON in each node, like this.
{ \"col1
Use from the magic words For JSON
example:
SELECT name, surname
FROM emp
FOR JSON AUTO
result:
[{"name": "John"}, {"name": "Jane", "surname": "Doe"}]
more info in:
https://docs.microsoft.com/en-us/sql/relational-databases/json/format-query-results-as-json-with-for-json-sql-server?view=sql-server-2017&viewFallbackFrom=sql-server-2014