The procedure generates an import script for SQL Server Management Studio diagrams.
Easy to use, takes one diagram name and an optional parameter, if is first diagram to script.
List the database diagram(s) for current database:
select * from sysdiagrams;
The script is based on several other scripts, see the References section.
Example of usage:
execute tool.ScriptDiagram 'First', 1; execute tool.ScriptDiagram 'Second', 0; execute tool.ScriptDiagram 'Third', 0;
Note
Objects required to use database diagrams is added for owner, when clicking on Database Diagrams in SSMS.
Further reading
References
Revisions
- 1.3 2017-03-22 Fixed links and use only tab in code
- 1.4 2017-10-23 cleanup procedure
- 1.5 2018-05-25 cleanup procedure, no dates