Red Gate forums :: View topic - TableDifference and additions/deletions
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

TableDifference and additions/deletions

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



Joined: 19 Jul 2012
Posts: 1

PostPosted: Thu Jul 19, 2012 7:50 am    Post subject: TableDifference and additions/deletions Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6581

PostPosted: Fri Jul 20, 2012 10:37 am    Post subject: Reply with quote

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)
{
...
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