Compare Options.Default seems to always be on

findtimfindtim Posts: 10

I have need to use specific options during my compare and part of the requirement is to not have the default options. I have used the logical OR to add together the options I want, but the default always seems to be used. I have resorted to specifying none as you will see below, but still I see this behavior. And not only in the SDK, but also in the command-line version of SQL Compare. Here is a snippet of code that I used to accomplish the requirements. Where am I going wrong? :
Private Const myDefaults As Long = Options.None
    TargetDB.Register(targetConnProps, myDefaults)
    SourceScripts.Register(SourceCodeLocation, New ReadFromFolder.ScriptDatabaseInformation(), myDefaults)
    Dim folderVsDB As Differences
    folderVsDB = TargetDB.CompareWith(SourceScripts, myDefaults)
            Dim difference As Difference
            For Each difference In folderVsDB
                difference.Selected = True
            Dim work As New Work()
            work.BuildFromDifferences(folderVsDB, myDefaults, False)
RedGate.SQLCompare.Engin.dll version is

Any help is much appreciated.[/code]


  • Thanks for your post.

    I'm not really sure what the problem could be, I've tested it and it and you can configure the options on the command line and using the API.

    When you step through the code, what is myDefaults set to?

    If it's set to 0, what are the symptoms that make you think it's using the default options?
  • If I use the same options in the SDK or cmdline vs SQL Compare client. SQL Compare shows no changes, SDK shows changes.
  • Are you using the very same SQL Compare engine?

    What kind of differences does it report?
  • When it comes down to it - what I care most about is that it seems to want to include dependencies even those I am not using the default options and I am not choosing Options.IncludeDependencies.

    That is the big issue
  • Sorry for the delay; I missed your last post.

    I'm not sure why the option would be used if it isn't set, I haven't seen that happen before. If you would like me to take a look at your project, feel free to reply to the support ticket we have open for you. (I'll send this message via the ticket as well).

    Does the problem also occur if you use one of the sample applications, and remove the 'IncludeDependencies' option?
  • Chris thank you for your reply about how to address what I was seeing. From my untrained eye it appeared that SQL Compare SDK was pushing dependencies, when really it was refreshing views because of the differences loop logic that I was using.

    This logic worked.
     Dim difference As Difference
     For Each difference In folderVsDB
      If difference.Type = DifferenceType.Equal Then
        difference.Selected = False
        difference.Selected = True
      End If

    Thanks again.
Sign In or Register to comment.