check if the table is Deselected in .sdc file, using API.

Automate and integrate using the SQL comparison API

Moderator: Chris Auckland

check if the table is Deselected in .sdc file, using API.

Postby jamest85 » Fri Apr 30, 2010 8:58 pm

Hi:
I created a .sdc file by using "SQL Data Compare" tool, below is part of:
Code: Select all
 <TableActions type="ArrayList" version="1">
    <value version="1" type="SelectTableEvent">
      <action>SelectItem</action>
      <val>[dbo].[WidgetDescriptions]:[dbo].[WidgetDescriptions]</val>
    </value>
    <value version="1" type="SelectTableEvent">
      <action>DeselectItem</action>
      <val>[dbo].[Contacts]:[dbo].[Contacts]</val>
    </value>
    <value version="1" type="SelectTableEvent">
      <action>DeselectItem</action>
      <val>[dbo].[WidgetPrices]:[dbo].[WidgetPrices]</val>
    </value>
    <value version="1" type="SelectTableEvent">
      <action>DeselectItem</action>
      <val>[dbo].[WidgetPurchases]:[dbo].[WidgetPurchases]</val>
    </value>
    <value version="1" type="SelectTableEvent">
      <action>DeselectItem</action>
      <val>[dbo].[WidgetReferences]:[dbo].[WidgetReferences]</val>
    </value>
    <value version="1" type="SelectTableEvent">
      <action>DeselectItem</action>
      <val>[dbo].[Widgets]:[dbo].[Widgets]</val>
    </value>
  </TableActions>



As you can see I only want to compare [dbo].[WidgetDescriptions], because it is: SelectItem, other tables are DeselectItem.

My question is: how to get those DeselectItem and then apply: mapping.include = false?

Code: Select all
 foreach (TableMapping mapping in mappings.TableMappings)
    {
       //if the table is "DeselectItem", but I don't know how.
        mapping.Include = false;
       
    }


Thanks a lot.

JT
jamest85
 
Posts: 4
Joined: Wed Apr 21, 2010 10:30 pm

Postby Brian Donahue » Mon May 03, 2010 12:56 pm

Hi James,

I think that you are probably doing the best thing. Mappings are done by recording the things that the user did in the "tables and views" and "object mappings" tabs, so just because there is a "SelectItem" in the project mappings doesn't prevent a later "DeselectItem" from unmapping it.

The only way that you can double-check the user actions is to verify the end-result.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests