Alter View difference has Selected=false, but still executes

Automate and integrate using the SQL comparison API

Moderator: Chris Auckland

Alter View difference has Selected=false, but still executes

Postby sdwire » Tue Mar 17, 2009 4:47 pm

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?
sdwire
 
Posts: 2
Joined: Tue Mar 17, 2009 4:38 pm

Postby Michelle Taylor » Tue Mar 17, 2009 6:44 pm

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.
Michelle Taylor
 
Posts: 529
Joined: Mon Oct 30, 2006 12:45 pm
Location: Red Gate Software

Postby sdwire » Tue Mar 17, 2009 7:26 pm

BINGO!

That was exactly it. Thanks!
sdwire
 
Posts: 2
Joined: Tue Mar 17, 2009 4:38 pm


Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests