Consider the following scenario. In Microsoft SQL Server 2005, you configure a merge replication. Then, you deploy the snapshot to a subscriber. In this scenario, when you run the Merge Agent to synchronize data, the operation times out when the Merge Agent calls the
sp_MSmakegeneration stored procedure.
Additionally, when you run the following statement against the replicated database of the subscriber after the operation times out, the query returns some records that are susceptible to the issue:
select * from dbo.MSmerge_genhistory gh
where not exists
(select * from dbo.MSmerge_contents as mc
where mc.generation = gh.generation)
and not exists
(select * from dbo.MSmerge_tombstone as ts
where ts.generation = gh.generation)
and genstatus = 0
union
select * from dbo.MSmerge_genhistory gh
where exists
(select * from dbo.MSmerge_contents as mc
where mc.generation = gh.generation
and mc.tablenick <> gh.art_nick)
or exists
(select * from dbo.MSmerge_tombstone as ts
where ts.generation = gh.generation
and ts.tablenick <> gh.art_nick)
and genstatus = 0