Visual Studio 数据库版本中的循环引用

发布于 2024-08-28 04:27:03 字数 298 浏览 8 评论 0原文

我正在使用 Visual Studio Database Edition 编写多个数据库的脚本。许多数据库之间都有引用 - 例如,数据库 A 中的视图可能会 select ... from B..TableX

只要数据库 B 也是解决方案中的项目,这就可以正常工作。当我在数据库 A 中的对象引用数据库 B 数据库 B 引用数据库 A 中的对象时,问题就出现了。看起来 Visual Studio 需要按顺序构建项目,这在这种情况下显然是不可能的。

在 Visual Studio 数据库版本中如何处理数据库项目之间的循环引用?

I'm using Visual Studio Database Edition to script a number of databases. Many of the databases have references between them - for example, view in database A might do select ... from B..TableX

This works fine as long as database B is also a project in the solution. The problem comes in when I have objects in database A referencing database B and database B referencing objects in database A. It seems like Visual Studio needs to build the projects in order which is obviously not possible in this case.

How do you deal with circular references between database projects in Visual Studio database edition?

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

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

发布评论

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

评论(2

少女七分熟 2024-09-04 04:27:03

绝对是个麻烦。我通过最初将项目 A 中依赖于项目 B 的各个对象设置为“不构建”(右键单击对象>属性)来处理此问题。然后构建项目。完成后,您可以构建项目 B。然后返回并将项目 A 中的对象设置回“构建”。

Definitely a hassle. I've dealt with this by initially setting individual objects in project A which are dependent on project B to "not build" (right click object>properties). Then building the project. Once this completes you can build project B. And then go back and set the objects in Project A back to "build".

以酷 2024-09-04 04:27:03

我们通常会找到完全避免循环引用的方法,就像使用 .NET 或大多数其他非数据库语言一样。
(例如:将 A 中依赖于 B 的内容移动到新数据库,C)

为此迁移表和视图有点麻烦,但是当需要进行自动化数据库部署时,它使该过程变得更加简单比必须对每个数据库进行部分构建并通过第二步返回并完成要简单得多。

We've generally found ways to just avoid the circular references altogether, the same way we would with .NET or most other non-database languages.
(ex: move the stuff in A that depends on B to a new database, C)

It's a bit of a pain to migrate tables and views to do this, but when it comes time to do automated database deploys, it makes that process a lot simpler than having to do partial builds of each database with a second step to go back and finish.

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