SQL table to HTML table

In our database career as a developer or DBA, we get new challenges everyday. We get many things to research upon and apply them in real time. In starting days of my DBA career, one of my task was to run a query on the database and send the returned result set in excel format to general manager every morning without fail. It was a very small analytic report. My manager did not want to put this report inside the application and make user friendly because the query was pretty heavy and needed to run in off business hours only. As a junior DBA, this was my responsibility. One fine morning, I felt this task tedious and planned to automate the same. I did it by writing a small script to form a HTML table dynamically, replica of my SQL result set and scheduled the same in job scheduler to have it run in off business hours. I was appreciated by manager for the same.  Find the below query which will dynamically add html table row and table data to form a HTML table.SQLTOHTML_01



Prasad Sahoo

Prasad Sahoo, is an enthusiast of Microsoft technologies in general and a passionate database professional, mainly focusing on SQL Server performance tuning and business intelligence. He has contributed a long time of his career working on SQL Server and other RDBMS. If he is not busy with SQL stuff then he must be watching some Hollywood movies.

Leave a Reply

%d bloggers like this: