Question: how to convert table data into json format in sql server?
Answer: There are two ways that relational results can be converted into JSON, namely, the AUTO and PATH options. This is the simplest way to convert relational data into a JSON format as all that you have to do is to add FOR JSON AUTO clause at the end of your SELECT statement.