March 10, 2009
This is a slightly tweaked version of the excellent script written by Craig Dunn
over at conceptdevelopment.net
. What is does is create a couple SP's and a function that allow you script your SQL Server diagrams to move them between databases. Read the more detailed article on Craig's site if that is not clear enough.
Basically the only meaningful change I made was to change the DiagramSuffix to use the ISO date format rather than the more verbose format with spaces used in the original Tool_ScriptDiagram2005
To make life easier , I also combined Craig’s original function and SP scripts and incorporated the wrapper SP, Tool_ScriptDiagrams2005
, contributed by Voislav
into a single script.
You can download the tweaked version here: script-sql-diagrams.zip
To script a single diagram, run the following in a SQL query window:
To script all diagrams in the DB, run the following in a SQL query window:
Applies to SQL Server 2005, SQL Server 2008.