Ignore Table Index Differences

Automate and integrate using the SQL comparison API

Ignore Table Index Differences

Postby bondjw07 » Tue May 20, 2014 6:01 pm

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
Posts: 2
Joined: Tue May 20, 2014 5:45 pm
Location: United States

Multiple Ignores?

Postby bondjw07 » Wed May 21, 2014 3:47 pm

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:
Code: Select all
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.
Posts: 2
Joined: Tue May 20, 2014 5:45 pm
Location: United States

Postby stanori » Thu May 22, 2014 2:02 pm

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.
Posts: 84
Joined: Mon Apr 23, 2012 12:13 pm

Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests