SQL 2005 - any way to restore/copy a diagram?
I used the Redgate packager (ran MSI) to reset all the data in my database (i.e. I deleted everything, and let it build t开发者_StackOverflow中文版he new database). Unfortunately, I discovered that it didn't retain my diagrams, which has a nice arrangement and several annotations.
Is there any way to copy/migrate/script the diagram from one database to another (the databases have identical structures).
Thanks, Neal Walters
You could try this using SQL2008 (may be different in SQL2005):
set IDENTITY_INSERT stackoverflow.dbo.sysdiagrams ON
--
insert into stackoverflow.dbo.sysdiagrams (name, principal_id, diagram_id, version, definition)
select name, principal_id, diagram_id, version, definition
from dbo.sysdiagrams
--
set IDENTITY_INSERT stackoverflow.dbo.sysdiagrams OFF
Your target database will have the copied diagrams.
精彩评论