Saturday, August 07, 2010

Some T-SQL, XML, DGML and Visual Studio 2010 and you get a very cool SQL Server Dependency Graph

Sev17 - SQL Server Object Dependency Viewer Revisited

“A year ago I blogged about building a SQL Server 2008 Object Dependency Viewer based on a script by PowerShell MVP, Doug Finke (Blog|Twitter). Since then Doug has created an alternative solution based on the new Microsoft Automatic Graph Layout features in Visual Studio 2010. The approach Doug takes builds a DGML XML file using PowerShell which then can be opened in Visual Studio 2010.

I thought it would be interesting to create an updated version of the SQL Server Object Dependency Viewer using DGML. Rather than simply running Doug’s script as-is I decided to develop an alternative solution targeted for SQL Server. Because the new solution only requires creating a DGML XML file and SQL Server can emit XML natively I used the following T-SQL/XQuery (no PowerShell required! Nonetheless I included a one-liner at the end of this post)

image…”

One of my past beefs/whines with Data Dude (aka Database Professional, Database Projects, etc) was the lack of diagramming or visualization. I like seeing my table relationships visually and it bugged me that I had to us other tools to see them. Data Dude is just SO close, and it’s not like there isn’t like a billion different diagramming things already in the project… yada, yada, whine, whine.

So anyway…

Chad’s work feels like the starting point for creating our own database visualization/diagramming capability… This screams out to be implemented as a Visual Studio Extension, doesn’t it? :)

 

Related Past Post XRef:
NodeXL, PowerShell and building a visual SQL Dependency Graph

1 comment:

Doug said...

Absolutely! It is begging to be an extension.