Red Gate forums :: View topic - check if the table is Deselected in .sdc file, using API.
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK Previous Versions
SQL Comparison SDK Previous Versions forum

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

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
jamest85



Joined: 21 Apr 2010
Posts: 4

PostPosted: Fri Apr 30, 2010 8:58 pm    Post subject: check if the table is Deselected in .sdc file, using API. Reply with quote

Hi:
I created a .sdc file by using "SQL Data Compare" tool, below is part of:
Code:

 <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:

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


Thanks a lot.

JT
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6645

PostPosted: Mon May 03, 2010 12:56 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group