SQL Comparison SDK

Latest version: 10.0

SQL Comparison SDK

Knowledge Base

Excluding a table from a data comparison

Category: SDK, API & Command line
Date: 03 Feb 2011
Product: SQL Comparison SDK
In the commercial version of SQL Data Compare, it is possible to exclude a whole SQL Server table from a comparison. This is also possible using the SQL Comparison SDK data comparison libraries using the mapping class.

Each Data Compare mapping has a property called "Include", which you can set to true or false, depending on whether the table's data should be included in the comparison. Here is an example where a table called foo, which had previously been successfully mapped using the CreateMappings method, is being excluded from the data comparison:

  1. [C#]
  2.   Database db1=new Database();
  3.       Database db2=new Database();
  4.  
  5.       db1.RegisterForDataCompare(new ConnectionProperties(".", "WidgetDev"), Options.Default);
  6.       db2.RegisterForDataCompare(new ConnectionProperties(".", "WidgetLive"), Options.Default);
  7.  
  8.       // Create the mappings between the two databases
  9.       TableMappings mappings = new TableMappings();
  10.       mappings.CreateMappings(db1.Tables, db2.Tables);
  11. mappings["[dbo].[foo]"].Include=false;
  12.  
  13. ...
  14. [/C#]

Document ID: KB200708000091 Keywords: SQL,SDK,data,compare,table,exclude,mappings

Was this article helpful?

Search support
Forums

SQL Comparison SDK

all SQL products

all products