Alter View difference has Selected=false, but still executes

I'm working on a project that has four views defined that access an external database. These are essentially identity views that will never change once installed. I want to exclude these views from the execution script for the differences, even though the name of the external database will be different across different environments.

The solution I have attempted is to iterate the Differences collection and set difference.Selected=false whenever I identify a difference for one of these specific views.

I can confirm with the debugger that the differences for these four views do indeed have Selected=false, but when I generate the ExecutionBlock, the synchronization script still has the code to alter those four views.

How can I prevent these four views from being included in the synchronization script?

Comments

  • Michelle TMichelle T Posts: 566 Gold 1
    Getting included as a dependency is the leading cause of unexected objects being included in the synchronization script, and dependencies are included by default.

    To avoid including dependencies, check what options you're using - you'll need specify the exact set of options you want, rather than just using Options.Default which contains the option Options.IncludeDependencies.
    Software Developer
    Redgate Software
  • BINGO!

    That was exactly it. Thanks!
Sign In or Register to comment.