Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.66 KB

readme.md

File metadata and controls

55 lines (39 loc) · 1.66 KB

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