How to make a select and return the result as XML or JSON.

  SQL Advanced

This functionality only works on the latest versions of SQL Server, FOR XML needs the 2014 version and the FOR JSON 2017 version.

 SELECT Column1, Column2, *   FROM Table   FOR JSON AUTO  
 SELECT Column1, Column2, *   FROM Table   FOR XML AUTO