Create an interactive HTML webpage after running a SQL Query to create a XML representation of the schema.
I needed a way to understand SQL Server Schemas for databases that I didn't have direct access to either due to its size or the location. The SQL Script is relatively simple to run and it can be transported as a simple text file for me to then generate the schema report.
- Get a copy of the SQL script generate-table-xml.sql
- Open
SQL Server Management Studio
to run the SQL script in the Query Window. - Change the database
- Run the script and copy / paste the output into a text file called
database.xml
- Using the Batch file in the src run the script pointing to the
database.xml
and the output directory (see generate-Adventureworks.cmd for an example).
This project has been built on Windows and includes the nxslt.exe
and libxml
binaries for html document creation
Project has been created on SQL Server 2008 R2.
Other SQL versions may have slightly different formats.
The purpose of this project is to allow a simple SQL script to be run on a SQL server database to extract the schema into an XML document. The xml document is then converted to a HTML web page showing the table structure and relationships.
- Joe Plant - Initial work - JoePlant
This project is licensed under the MIT License - see the LICENSE.md file for details