Search code examples
visual-studiodeploymentdatabase-projectdatadude

Is there a way in a visual studio database project to exclude certain object during deployment?


I have a scenario where I am using a visual studio 2010 database project to deploy changes to multiple database installations, but on certain ones I want to exclude a set of views from that copy. Is there a way using build configurations to exclude these views from being deployed?


Solution

  • Have you tried creating a composite project? I haven't implemented this scenario myself but it would seem you could:

    1. Create project1 which consists of the core objects required for all deployments.
    2. Create project2 which consists of the set of views required for some deployments.
    3. Add a reference to project1 in project2.

    Thus when deploying project1, the views would not be included and when deploying project2, the views as well as the core objects would be included.

    Have a look at the following Microsoft link. In particular the section titled "Uses and Limitations of Composite Projects"

    http://msdn.microsoft.com/en-us/library/dd193405.aspx