• 0

[SQL] Generating HTML Report from simple SQL statement


Question

Hi!

I wanted to generate a small report (HTML if possible) from the results of a simple SQL query.

eg. select * from students

Anyone knows best/fast approach to this?

thanks.

Newton

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Well it depends on which database you are using.

If you are using SQL Server then add FOR XML AUTO syntax at the end of your query:

Select *
From Students
FOR XML AUTO

This will cause SQL Server to create an XML representation of the results which you can use with an XSLT stylesheet to generate your HTML for display.

Link to comment
Share on other sites

  • 0

What tool are you using to create your query? I use TOAD, and you can export results into a number of formats, including HTML.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.