开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜