Red Gate forums :: View topic - Problem with IncludeTimestamp
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

Problem with IncludeTimestamp

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



Joined: 07 Oct 2010
Posts: 1

PostPosted: Thu Oct 07, 2010 8:39 pm    Post subject: Problem with IncludeTimestamp Reply with quote

Hi,

I am using the api with the datacompare to compare 2 databases. I am using the following code for the mapping options

Code:
private EngineDataCompareOptions _options = new EngineDataCompareOptions(
                                                MappingOptions.IgnoreSpaces | MappingOptions.IncludeIdentities | MappingOptions.IgnoreCase,
                                                ComparisonOptions.Default,
                                                SqlOptions.Default );


I have timestamps on every table, so I want to ignore those timestamps.

Unfortunately I cannot find the right mix. These options get me to have no Sames in any of the tables.

When the compare creates a script, it excludes all of the changes that are due to timestamp, but I can't get the number counts right.

What am I doing wrong?

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



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Mon Oct 11, 2010 2:11 pm    Post subject: Reply with quote

Hello,

There is an option to ignore timestamps in an "atomic" way, so that you do not have trawl through all of the column mappings looking for timestamp columns.

All that you should need to do is unset MappingOptions.IncludeTimestamps in the first argument to EngineDataCompareOptions (if it is set you can use an XOR operator, for instance in C# MappingOptions.Default ^ MappingOptions.IncludeTimestamps)

In the data compare engine, timestamps can only be compared and the synchronization will ignore them anyway. For this reason, the setting should only affect any display of the data diferences, but not the actual script.
Back to top
View user's profile Send private message
jimmypooh



Joined: 12 Oct 2010
Posts: 8

PostPosted: Tue Oct 12, 2010 3:00 pm    Post subject: same error this doesn't fix Reply with quote

I am also having this problem using the following:
Code:

private EngineDataCompareOptions _options = new EngineDataCompareOptions(MappingOptions.Default ^ MappingOptions.IncludeTimestamps,ComparisonOptions.None,
                                                SqlOptions.DisableKeys | SqlOptions.DisableTriggers | SqlOptions.DropConstraintsAndIndexes | SqlOptions.OutputComments);

The timestamps still do not allow anything to be compared as the same.

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



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Tue Oct 12, 2010 3:58 pm    Post subject: Reply with quote

Are you absolutely positive that the timestamp columns are the source of the differences?
Back to top
View user's profile Send private message
jimmypooh



Joined: 12 Oct 2010
Posts: 8

PostPosted: Tue Oct 12, 2010 5:45 pm    Post subject: Reply with quote

Yes, I have double checked.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Tue Oct 12, 2010 6:13 pm    Post subject: Reply with quote

...Using same the EngineDataCompareOptions in all three places? (I believe mappings, session, and provider all need to use the same options).
Back to top
View user's profile Send private message
jimmypooh



Joined: 12 Oct 2010
Posts: 8

PostPosted: Tue Oct 12, 2010 7:21 pm    Post subject: Reply with quote

That did the trick. I was not setting the options until after CreateMappings[/code]
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