SQL 2005 - 有什么方法可以恢复/复制图表吗?

发布于 2024-08-30 11:59:07 字数 171 浏览 8 评论 0原文

我使用 Redgate 打包程序(运行 MSI)重置数据库中的所有数据(即我删除了所有内容,并让它构建新数据库)。不幸的是,我发现它没有保留我的图表,这些图表有很好的排列和一些注释。

有没有办法将图表从一个数据库复制/迁移/编写脚本到另一个数据库(数据库具有相同的结构)。

谢谢, 尼尔·沃尔特斯

I used the Redgate packager (ran MSI) to reset all the data in my database (i.e. I deleted everything, and let it build the 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

第几種人 2024-09-06 11:59:07

您可以使用 SQL2008 尝试此操作(在 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

您的目标数据库将具有复制的图表。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文