I want to return JSON or a Table result set (normal) based on a parameter that I am passing to a SQL Server stored procedure.
SELECT
emp.Name,
emp.EmpID
FROM
Employee emp
ORDER BY
emp.Name
FOR JSON Path;
This will return one column with a string JSON result.
I want to make this optional based on a parameter. Basically I want to re-use the stored procedure for JSON as well as normal result.