SSDT Round Job / Unresolved Reference Workaround

I just started doing SSDT and already got into a problem.

My solution consists of 2 databases. Both databases reference each other using synonyms. So we have circular links regarding SSDT.

I am aware of design issues with such an arrangement, so I donโ€™t need to comment on this or suggest structural changes to the database itself. This is an existing system, and I cannot change it structurally.

I also know that SSDT will not allow circular links. There is a workaround here ( http://social.msdn.microsoft.com/Forums/en-US/ssdt/thread/5fd12f01-54e6-4e7d-b7e2-14fa9df9a7ef ). He suggests dividing DB1 into 2 projects DB1 and DB1a, for example, where DB1a refers to DB1 and DB2 and makes a link to DB2 DB1. But I'm not sure how to configure this to work without actually creating an additional database.

I think my only option is to leave it as 2 projects, but set them to ignore unresolved links.

+6
source share
1 answer

As mentioned in the comments, I suggest considering considering deploying your triggers as Post-Deployment scripts in any of the two existing database projects.

Please note that in doing so, you will not be able to reference the triggers themselves in the SSDT database project (unless these objects are also included in the post-deployment script). Not sure if there really is a type of object that can be dependent on a trigger, but I thought it was worth mentioning :).

+4
source

Source: https://habr.com/ru/post/926336/


All Articles