sql server replication:
Dear All,
Our system is built-in SQL 7.0.
I had one publisher and 3 subscription in 3 different location.
And recently one of the subscription got the erorr "The merge process
could not retrieve generation information at the Subscriber."
sometimes.
Can anybody advise how I can do ?
And in the publisher , I never removed the the records of
MSMerge_contents, MSmerge_tombstone, and MSmerge_genhistory . Do I need
to do it ?
Moreover, I have the following scripts, can I use it to maintain the
MSmerge_contents, MSmerge_tombstone, and MSmerge_genhistory ?
Thanks
Kelvin
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
create procedure sp__mergepurgemetadata
as
declare @purgedate datetime,
@command varchar(1000)
select @purgedate = dateadd(dd, -1 * 360+ 1, getdate())
-------------------------------------------------- PART 1
---------------------------------------------------
--Remove the specified generations from MSmerge_contents
select @command = 'delete rpx..MSmerge_contents from
rpx..MSmerge_contents a, ' +
'rpx..MSmerge_genhistory b where a.generation =
b.generation and ' +
"b.coldate < '" +
convert(char(10),@purgedate,101) + "'" + ' and a.generation > 0'
begin transaction
exec(@command)
commit transaction
-------------------------------------------------- PART 2
---------------------------------------------------
--Remove the specified generations from MSmerge_tombstone
select @command = 'delete rpx..MSmerge_tombstone from
rpx..MSmerge_tombstone t, ' +
'rpx..MSmerge_genhistory b where t.generation =
b.generation and ' +
"b.coldate < '" +
convert(char(10),@purgedate,101) + "'" + ' and t.generation > 0'
begin transaction
exec(@command)
commit transaction
-------------------------------------------------- PART 3
---------------------------------------------------
--Remove the specified generations from MSmerge_genhistory
select @command = 'delete rpx..MSmerge_genhistory where coldate <
"' +
convert(char(10),@purgedate,101) + '" and pubid
is not null'
begin transaction
exec(@command)
commit transaction