Ignore Table Index Differences

bondjw07bondjw07 Posts: 3
I am attempting to use the SDK to compare 2 tables. These table are identical with the exception of their indexes. In the SQL Compare windows app, I can ignore indexes from within the Project Configuration->Options screen. I am wonder how I can do this from within the SDK comparison. Thanks


  • Ok, so I figured out how to ignore indexes, but I would also like to ignore other items. Here is the code I am using:
    Dim objDatabase1 As New Database
    Dim objDatabase2 As New Database
    Dim objDifferences As Differences
    objDifferences = objDatabase1.CompareWith(objDatabase2, Options.IgnoreIndexes)
    So I the above code, Options.IgnoreIndexes is allowing me to ignore indexes. However, I lose the ability to also use the default options. I would like to have the default options plus the ability to ignore indexes. I tried objDatabase1.CompareWith(objDatabase2, Options.IgnoreIndexes or Options.None), but that doesn't seem to give me the expected results.
  • Hi bondjw07,

    Thanks for your post. In regards to your question about keeping the defaults, and adding the ignore indexes, starting with version 10.5 of the SDK, there is a new class called "Options.Default.Plus" that can be used to use the default options, plus which ever additional options you would like to add to the project.

    In previous versions of the SQL Comparison SDK, comparison options were specified as a bit flags enum. For example:

    Options.Default | Options.DropAndCreateInsteadOfAlter

    In version 10.5, options are specified using the methods in the Options class. For example:


    For more details see:
    https://documentation.red-gate.com/disp ... n+SDK+10.5

    Hope this helps.

    Best Regards,
    Steve Tanori
    Product Support
    Red Gate Software Ltd.
Sign In or Register to comment.