如何将 SQL MDF 文件迁移到生产 SQL Server? (ASP.NET)

发布于 2024-09-14 19:27:11 字数 164 浏览 5 评论 0原文

我有一个 ASP.NET 项目,也使用 SQL MDF 文件。我的目标服务器是 SQL 2008R2 或 SQL Azure。

我想知道从 DEV 迁移到 PROD 时有哪些部署选项。以防万一,我不受任何维护 PII 或类似私人数据的监管。

如何将我的测试模式和数据转移到生产环境?

I have an ASP.NET project that also uses a SQL MDF File. My target server is SQL 2008R2 or SQL Azure.

I would like to know what deployment options I have as I migrate from DEV to PROD. In case it matters I'm not under any regulation to maintain PII or similarly private data.

How do I move my test schema and perhaps data to production?

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

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

发布评论

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

评论(3

驱逐舰岛风号 2024-09-21 19:27:11

您可以通过将 MDF 文件附加到新的 SQL Server 来移动整个数据库,包括数据。否则,您可以选择所有对象并生成 CREATE 脚本来复制架构。

You can move the entire database, including the data by attaching the MDF file to the new SQL server. Otherwise you can select all objects and generate CREATE scripts to copy the schema over.

挽心 2024-09-21 19:27:11

是的,您可以直接附加到 MDF 文件,或者进行备份/恢复以将其转移到 SQL Server 2008。

我还没有使用过 SQL Azure...据我所知,我认为您可能会陷入困境按照 durilai 建议编写数据脚本(最后我听说我们不允许对 SQL Azure 进行备份/恢复)。

Yes, you can attach to the MDF file directly, or do a backup / restore to get it over to SQL Server 2008.

I haven't played with SQL Azure... From what little I've heard I think you might be stuck scripting the data as durilai suggested (last I heard we're not allowed to do backups / restores for SQL Azure).

记忆里有你的影子 2024-09-21 19:27:11

在 SQL Server 管理工具中,右键单击数据库,然后单击“将数据库脚本编写为”为数据库创建 SQL 脚本。如果需要数据,您还可以在表级别执行类似的操作。

In SQL Server Management tools, right click on the database and click 'Script Database As' to create an SQL script for your database. You can also do something similar at the table level if you want the data.

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