Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 423
  • Last Modified:

SQL Replication tablediff

Hi,

Second question of the day.. just discovered the tablediff utility. Nice..

I have used it to generate a script and it has done for my table that is out of sync on the subscriber by 2 records due to the subscriber server crashing.

If I run this script to insert the missing records at the subscriber will replication try to insert them at the publisher? And will this cause a problem?

Im guessing it will throw up a conflict.. but I can just answer the conflict with let loser win or something like that??

SQL Server 2008
Windows server 2008
Merge Replication

Thanks

Antony
0
gardmanIT
Asked:
gardmanIT
  • 4
  • 4
  • 3
1 Solution
 
Anthony PerkinsCommented:
If I run this script to insert the missing records at the subscriber will replication try to insert them at the publisher? And will this cause a problem?
Yes and yes.

>>but I can just answer the conflict with let loser win or something like that??<<
No.  You need to Reinitialize the Subscription.
0
 
gardmanITAuthor Commented:
And what does re initialize the subscription do? Will it cause it to re download the entire database to the subscriber... as that would be a MAJOR problem for me given the DB is over 16GB!
0
 
Anthony PerkinsCommented:
It will re-sync the differences using the current snapshot as the source, unless you re-initialize the snapshot, in which case yes, it will "download the entire database to the subscriber" as you put it.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Scott PletcherSenior DBACommented:
>> If I run this script to insert the missing records at the subscriber will replication try to insert them at the publisher? And will this cause a problem? <<

Yes.

Maybe.  Merge replication has conflict resolution potential, so it would depend on the exact settings and transactions.  In most cases, you can also direct SQL on how to resolve conflicts, again depending on the specific settings for the merge replication when you set it up.
0
 
Anthony PerkinsCommented:
Oops, I missed that detail.  I am sorry, I thought this question was related to Transactional not Merge Replication.
0
 
gardmanITAuthor Commented:
I took the script that table diff created. I ran it at the Subscriber to insert the missing records..

...and Replication....

Did not complain or grumble it just continued working happily!!!

I also deleted some records at the Publisher that I couldnt insert at the subscriber, due to identity range management, and it again happily continued without a whimper or murmur!!

So there you go... non convergence issues use tablediff generate the script to insert the missing rows.. and insert them at the side that is missing the data.

Antony
0
 
Anthony PerkinsCommented:
Did not complain or grumble it just continued working happily!!!
Yes, sorry about that.  It would have helped if I had read the question.
0
 
Scott PletcherSenior DBACommented:
>> Did not complain or grumble it just continued working happily!!! <<

That's why I said "maybe".  It depends on what the associated key values were, and the details of how merge replication was defined.


Glad it worked out for you!


Reinitializing a subscription is easy to specify, but it can take a long time for SQL to actually do it, and it usually generates a lot of db and/or transaction activity.
0
 
Scott PletcherSenior DBACommented:
Good luck on future qs!!
0
 
gardmanITAuthor Commented:
Im sorry im not attempting to shun anyone here.. if you feel you should off had the points please say..
0
 
gardmanITAuthor Commented:
Although the other guys perhaps steered me, i took the plunge and tried my solution!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now