Skip to content

JoePlant/doc-sql-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doc-sql-database

Create an interactive HTML webpage after running a SQL Query to create a XML representation of the schema.

Why was this built?

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.

Getting Started

  • 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).

Example Output

AdventureWorks database

Relationship diagram

Prerequisites

This project has been built on Windows and includes the nxslt.exe and libxml binaries for html document creation

Running the tests

Project has been created on SQL Server 2008 R2.
Other SQL versions may have slightly different formats.

Deployment

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.

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments