Formats results of SELECT query as JSON text. FOR JSON PATH clause is added after query:
SELECT top 3 object_id, name, type, principal_id FROM sys.objects
FOR JSON PATH
Column names will be used as keys in JSON, and cell values will be generated as JSON values. Result of the query would be an a...