How to create SQL Server documentation showing database dependencies visually

ApexSQL Doc features a built-in graphical dependencies viewer that can assist you in visually conveying your database dependencies in the final document.

To access the dependency features, launch ApexSQL Doc and start new project. Provide SQL server and database information and select the Explicitly parse database for improved dependency accuracy option and check the Graphical dependencies option in the Dependency options section, inside the Database options tab:

Quick tip icon

Please note:

You must first select the Dependency (parent and children) lists/tables option. Selecting this option can significantly slow the documentation process

Dependency-options-tab1.png

Besides having the ability to include visual dependencies diagrams in your SQL Server documentation, ApexSQL Doc also allows to set up visual dependencies diagram layout and visuals. Which relationships are included, the layout of the generated diagram, size of the diagram and the drill-down depth of your dependencies can be controlled.

In addition to including visual representations of object relationships, dependency relationship tables can be included, checking the Dependency (parent and children) lists/tables option:

Dependency type

The Dependency type option controls which relationships are included in the generated diagrams:

Dependency type option

  • Children only – Children objects depend directly on the specified object. Diagrams will show only the object and its children. Parents and the second generation descendants (grandchildren) will not be included:

    Childrenonly

  • Descendants – Descendant objects indirectly depend on the specified object via other objects. Diagrams will show the object and all descendants including children and grandchildren:

    Descendatnsonly

  • Parents and children only – A parent object is an object the specified one depends on. Parents diagrams will show the object plus its parents and children. Descendants will not be shown:

    ParentsandChildrenOnly

  • Parents and descendants – Diagrams will show all dependencies for the specified object, including parents, children, and descendants:

    ParentsDescendants

Depending on the choice made, the generated diagram will change.

Dependency layout

The Dependency layout option controls how ApexSQL Doc will organize the generated dependency diagrams in your SQL Server documentation:

Dependencylayout

  • Circular – Related objects will be shown in a circle around the object that they are related to:

    Circular

  • Force directed – Places the most frequently used objects nearer to the center of the diagram, with the least frequently used objects nearer to the outside of the diagram:

    ForceDirected

  • Hierarchical – Organizes objects based on the generation, so that parents are at the top of the diagram and descendants are at the bottom of the diagram, and all the objects from the same generation are in the same horizontal row:

    Hierarhical

  • Orthogonal – This option attempts to organize the objects in the diagrams in the way that they are at right angles to each other:

    Orthogonal

Visualization is ideal for quick analysis of existing dependencies, especially when, for example, there is a need to explore the model with multiple layers of views or tables. With that in mind, ApexSQL Doc offers a very useful and clear visualization of various objects and how they are interconnected as a part of a SQL server documentation.

Useful links:

How to: View Dependencies for Database Objects
Understanding SQL Dependencies
View the Dependencies of a Table

March 4, 2015