Red Gate forums :: View topic - Database.CompareWith limited to specific tables?
Return to www.red-gate.com RSS Feed Available

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

Database.CompareWith limited to specific tables?

Search in SQL Comparison SDK 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
JoergA



Joined: 06 Jul 2012
Posts: 1

PostPosted: Fri Jul 06, 2012 5:27 pm    Post subject: Database.CompareWith limited to specific tables? Reply with quote

Hi all:

I am evaluating SQL Comparison SDK for replicating a SQL database between remote locations. The tables to be synchronized are only about 10-20, but the database in total has some 2,000 tables. When running Database.CompareWith there seems to be no option to limit to specific tables, all the "filters" I have seen only take effect after the CompareWith has already taken place, which takes a long time for 2,000 tables even if the servers are on the same network. If I cannot limit the tables to be included in the CompareWith operation then I fear the SQL Comparison SDK will be useless for this kind of deployment...

Any clues on whether this is supported or not?

Thanks,

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



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Mon Jul 09, 2012 2:38 pm    Post subject: Reply with quote

Thanks for your question. There is no filtering capability on Database.Register or CompareWith because a complete schema needs to be constructed and the dependency chain computed. Once that's done, you can filter which objects will be synchronized, but not before.

The same basic idea applies to comparing data as well, except you can choose which tables to compare before running the comparison.
Back to top
View user's profile Send private message
StuM



Joined: 13 Sep 2012
Posts: 5

PostPosted: Thu Sep 13, 2012 2:22 pm    Post subject: Reply with quote

I achieved this by iterating through the table mappings before the comparison. There is an Include flag you can disable to remove a table from the comparison....

Code:
List<String> TablesToCompare = new List<String> { "Table1", "Table2" };
foreach (TableMapping in Mappings)
{
    if (TablesToCompare.Contains(Mapping.Obj1.Name))
    {
        Mapping.Include = true;
    }
    else Mapping.Include = false;
}
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Thu Sep 13, 2012 2:59 pm    Post subject: Reply with quote

Thanks for your followup.

As far as reading the schema, you can't stop the SQL Compare engine from reading absolutely all of it before you can map tables.

For data, there are a number of different ways you can filter - For vertical filters you can exclude tables and columns using mappings. For horizontal filters, you have a few options. The WHERE clause, at least, will allow you to compare a subset of data without dumping it all back on the client first.

Please see:
http://sdk.red-gate.com/index.php/Filtering_data_overview
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