Click here to Skip to main content Click here to Skip to main
content  Script SQL Server 2005 diagrams to a file  By , 7 Aug
2006 Sign Up to vote Add a reason or comment to your vote: x
Votes of 3 or less require a comment   Microsoft SQL Server 2000
has a feature that allows you to generate diagrams of your
schema. These diagrams are saved in a custom, binary format by
the Enterprise Manager in the [dtproperties] table - they are
backed-up with the rest of your data, but they are not easy to
transfer between databases or add to source control (like Visual
SourceSafe).  In order to move a diagram to another database (or
get it into a 'text' format for source control), you need to
extract the binary data from [dtproperties] and get it into a
more usable format - Clay Beatty wrote a tool to do just that
for SQL Server 2000.  The code for this article contains a
similar tool, re-written for SQL Server 2005. It consists of a
stored procedure and function that work together to generate a
set of INSERT/UPDATE state