문제

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?

도움이 되었습니까?

해결책

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".

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top