Skip to content

A tool to visualise a SQL Server schema using a graph database

License

Notifications You must be signed in to change notification settings

Otterpohl/sql-schema-graph

Repository files navigation

SQL Server Schema Graph Generator

This is a tool that will create a Neo4j Graph Database of SQL Server databases, mapping the objects' inter and intra dependencies.

Whilst Neo4j does have the capability to import data from SQL server directly, it does not represent a dataless schema very well. Especially when a database has been developed with very few Keys.


Setup

  1. Install Neo4j and configure your first project
  2. Install Python
  3. Edit the necessary configuration in the file called example.env and rename it to .env
  4. Run main.py
  5. Open Neo4j Desktop and query the sqldependencygraph database

Examples

The below examples are produced using Microsoft's AdventureWorksLT2019 database provided under the cc-by-sa 4.0 license.

Example 1 - Schema Dependencies Graph

CALL db.schema.visualization()

OR

CALL apoc.meta.graph()

Screenshot

Example 2 - Object (uspPrintError) Dependencies - Depth 1

MATCH (t {name: "uspPrintError"})-[r]-(a) RETURN *

Screenshot

Example 3 - Object (uspPrintError) Dependencies - Depth 3

MATCH (t {name: "uspPrintError"})-[r*1..3]-(a) RETURN *

Screenshot

Example 4 - Object Dependencies - All

MATCH (n) RETURN n

Screenshot

About

A tool to visualise a SQL Server schema using a graph database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published