| Author |
Message |
micmt
Joined: 19 Jul 2012 Posts: 1
|
Posted: Thu Jul 19, 2012 7:50 am Post subject: TableDifference and additions/deletions |
|
|
Effectively after comparison we should have left rows,right rows and different rows (i.e. deletions , additions, updates )
In your code samples ( TableMappingExample.cs) you seem to show only different rows
| Code: |
session.CompareDatabases(db1, db2, mappings);
TableDifference difference=session.TableDifferences["[dbo].WidgetPrices]"];
foreach(Row row in difference.ResultsStore)
... |
How we can see additions and deletions ? |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Fri Jul 20, 2012 10:37 am Post subject: |
|
|
Hello,
There are a few ways to do it... you can go through all of the rows using foreach and only print out rows that have a Type property of "In1" or "In2". You can also construct a ResultsReader that only shows "In1" or "In2" and iterate throug the results:
| Code: |
Reader resultsReader = session.TableDifferences["[dbo].[Widgets]"].ResultsStore.GetReader(Row.RowType.In1);
foreach (Row row in resultsReader)
{
...
|
_________________ 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