What tool generates diagrams from SQL Server hierarchical data?

前端 未结 2 570
星月不相逢
星月不相逢 2021-02-01 08:35

Is there a tool that works with SQL Server to generate tree-like diagrams from a hierachical data model?

I am working with a large geographical hierarchy, and would like

2条回答
  •  深忆病人
    2021-02-01 09:05

    Export and run it through GraphViz - you don't even have to generate the hierarchy (just export nodes and edges) - just assign node names which are unique based on your NodeID column and use those same node names in the edges.

    If you want something interactive, Microsoft has a Automatic Graph Layout library which can be used from .NET.

    Here's an introduction to GraphViz.

    What you are going to do is output a DOT file by exporting your SQL using a script like this: https://data.stackexchange.com/stackoverflow/q/109885/ which will run through GraphViz and generate your picture.

    The DOT syntax is relatively simple - you can write it by hand first and then generate that from SQL and simply paste it in a file or something else (like .NET or PowerShell) which reads the SQL sets and generates the file.

    You can automate that with SSIS. I made a package which wrote out the DOT file and ran graphviz on it and saved a graphiacl snapshot of our system on a daily basis.

提交回复
热议问题