| Author |
Message |
JoergA
Joined: 06 Jul 2012 Posts: 1
|
Posted: Fri Jul 06, 2012 5:27 pm Post subject: Database.CompareWith limited to specific tables? |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6369 Location: Red Gate Software
|
Posted: Mon Jul 09, 2012 2:38 pm Post subject: |
|
|
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. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
StuM
Joined: 13 Sep 2012 Posts: 5
|
Posted: Thu Sep 13, 2012 2:22 pm Post subject: |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6369 Location: Red Gate Software
|
Posted: Thu Sep 13, 2012 2:59 pm Post subject: |
|
|
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 _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|
|
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