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

Hi:
I created a .sdc file by using "SQL Data Compare" tool, below is part of:
 <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?
 foreach (TableMapping mapping in mappings.TableMappings)
    {
       //if the table is "DeselectItem", but I don't know how.
        mapping.Include = false;
       
    }

Thanks a lot.

JT

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
Sign In or Register to comment.