I came across this article (https://www.simple-talk.com/sql/sql-tools/automatically-creating-uml-database-diagrams-for-sql-server/) that shows how to easily create UML diagrams of database objects. In a nutshell here is how it works…
In the SQL Management Studio go to Tools -> Options -> Query Results -> SQL Server -> Results to Text and change the “Maximum number of characters displayed in each column” value to 8192. Then open a new query and click the “Results to Text” button.
Next, run this query with the object you want to diagram. In the example below I used moduleioc:
DECLARE @object_ID INT
+ object_name(referencing_ID) +' --|> '
WHERE (referencing_id =@object_ID
OR referenced_ID = @object_ID)
AND is_schema_bound_reference =0
and referenced_ID is not null
+ object_name(parent_object_ID) + ' --|> '
WHERE parent_object_ID = @object_ID
OR referenced_object_ID = @object_ID
You should the see something similar to this:
Copy all eight lines and paste them into the top box on this site between the @startuml and the @enduml. Before running remove all of the NULLs:
The resultant diagram looks like this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.