Sunday, 25 May 2025

Quick & Easy way to get data from SQL to HTML using FOR JSON

In this video, I teach you how to use the FOR XML and FOR JSON functions inside SQL Server.

I then take it a step further and give you a demo of how to quickly and easily put this data onto an HTML page with Visual Studio.

Finally, there is also a simple hack to get around the way the JSON FOR AUTO will link the table relationships, saving having to learn the other JSON functions within SQL.

Here is a link to the source code so you can try it yourself.