在 VS 2019 数据库项目中发布 DB 时如何避免删除架构

发布于 2025-01-15 15:59:18 字数 100 浏览 0 评论 0原文

从 Visual Studio 发布数据库时,有多个选项可以“不删除”对象(如果该对象不在源中)。然而,似乎没有办法避免删除模式。有谁知道这是否可以实现,或者我是否必须手动编辑发布脚本?

When publishing a database from Visual Studio, there are several options to "do not drop" an object if it is not in the Source. However, it seems that there is no option to avoid dropping schemas. Do anyone know if this is possible to achieve, or do I have to manually edit the publish script?

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

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

发布评论

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

评论(1

桜花祭 2025-01-22 15:59:19

将架构添加到项目中可能是最简单的。该脚本很简单,我们使用:

创建架构 [api]
授权[dbo];

(另外,我希望我早点看到这个问题,希望这对某人有帮助还不算太晚。)

It would probably be simplest just to add the schema to the project. The script would be simple enough, we use:

CREATE SCHEMA [api]
AUTHORIZATION [dbo];

(Also, I wish I'd seen this question much earlier, hopefully this isn't too late to help someone.)

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