如何在 SQL Server 数据库之间移动图表?

发布于 2024-07-19 12:56:20 字数 357 浏览 8 评论 0原文

我正在尝试将数据库从托管服务器移动到我自己的 SQLExpress 实例。 我使用数据库发布向导来创建脚本...但图表未传输。

然后,我找到并遵循了该网站上另一个答案的建议,该答案让我将数据导入/导出到 sysdiagrams 表。

当我这样做时,我会看到图表文件夹中的所有图表。 但是,当我尝试打开一个表时,我看到每个表的轮廓,然后收到一条弹出错误消息,其中显示:

“表已从图表中删除,因为这些表或表的权限已被删除( s) 被丢弃。”

当我退出弹出窗口时,所有表都将从图表中删除(除了作为一个图表一部分的几个 aspnet_xyz 成员资格表)。

您知道如何在不收到此消息的情况下传输图表吗?

I'm trying to move a database from a hosted server to my own SQLExpress instance. I used the Database Publishing Wizard to create the script... but the diagrams were not transferred.

Then, I found and followed the advice of another answer on this site that had me import/export the data to the sysdiagrams table.

When I do that, I see all of the diagrams in the Diagrams folder. However, when I try to open one, I see an outline of each table, then get a popup error message that says:

"Table(s) were removed from the diagram because privileges were removed to these table(s) or the table(s) were dropped."

When I exit from the popup, all of the tables are removed from the diagram (except for a couple of aspnet_xyz membership tables that were part of one diagram).

Do you know how I can transfer the diagrams without receiving this message?

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

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

发布评论

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

评论(4

柳若烟 2024-07-26 12:56:20

您需要删除图表,然后在右键菜单中使用“新建数据库图表”创建一个新图表并添加您需要的表,最后保存。

You need to delete the diagram and in the right click menu with the "New Database diagram" create a new one and add the tables you need, and save it finally.

将军与妓 2024-07-26 12:56:20

最简单的方法是创建整个数据库的备份并将其恢复到 Express 数据库。 您收到错误是因为图表不是简单的绘图 - 它们只是一些元数据并且它们依赖于它们显示的表格 - 您需要图表显示的表格。 如果您不想修改图表,只需将其导出为图像即可。

The simplest way is to create a backup of the whole database and restore it to your Express database. You are getting the error because the diagrams are no simple drawings - they are just some metadata and they rely on the tables they show - you need the tables shown by the diagram. If you don't want to modify the diagram, just export it as an image.

嘦怹 2024-07-26 12:56:20

我以前见过类似的东西,虽然不完全相同,但也许足够接近,可以适用于你。

您最初遇到的问题很可能与用户权限以某种方式与旧服务器绑定有关。

请参阅 http://forums.microsoft.com/MSDN/ ShowPost.aspx?PostID=120849&SiteID=1
这个: http://msdn2.microsoft.com/en-us/library/ ms143684.aspx

  • 您需要停止“SQL Server (SQLEXPRESS)”服务。

  • 然后删除“\Documents and Settings\用户名\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS”文件夹。

  • 重新启动 SQL Server。

  • 重新启动 Visual Studio。

我希望这有帮助。

I have seen something similar to this before, it wasn't quite the same but perhaps it's close enough to apply to you.

It is likely that the trouble that you were having initially was to do with user privileges being tied to the old server in some way.

Refer to http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=120849&SiteID=1 and
this: http://msdn2.microsoft.com/en-us/library/ms143684.aspx.

  • You will need to stop your "SQL Server (SQLEXPRESS)" service.

  • Then delete the "\Documents and Settings\Username\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS" folder.

  • Restart SQL Server.

  • Restart Visual Studio.

I hope that helps.

小矜持 2024-07-26 12:56:20

当我使用数据库发布向导重新编写整个数据库的脚本时,这个问题就停止了...这次我指定了“仅架构”而不是“架构和数据”。 完成此操作后,我能够使用导入/导出向导成功导入并打开图表。

This problem stopped when I re-scripted the entire database using the Database Publishing Wizard... This time I specified "Schema Only" instead of "Schema and Data." After I did this, I was able to successfully import and open the diagrams using the Import/Export wizard.

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