Groups | Blog | Home
all groups > sql server replication > march 2006 >

sql server replication : One table shared between 2 merge subscriptions


Adami DevOn
3/28/2006 7:30:04 AM
Is it possible to define 2 merge publications that contain same tables (one
publication has dynamic filters, the other hasn't) and to subscribe the same
DB to them?

--- Details ---
I have a HQ DB on SQL Server 2005, and a couple of hundreds of client DB's,
installed on laptops with SQL Server Express Edition (using DISTRIB.EXE &
REPLMERG.EXE for synchronizing).
I defined 3 publications with pull subscriptions:
- a transactional publication with global tables changed only at HQ - this
work fine
- one merge publication using dynamic filter SUSER_SNAME on one table (lets
say table A), the rest of the tables are filtered by using joining
- some tables that are used in the joins of the first merge publication, are
global tables (table A, where I put the dynamic filter, and tables B & C) -
so I put them in an other merge publication with no filters at all, defining
the tables A, B & C as "download only".

Client DBs structure is identical with HQ DB structure (including indexes,
PK, FX...), so I need to replicate only the data (and replication objects).
After defining the publication and the test subscription DB (on the same
server) everything seemed to work OK, but when I tried to define a new test
DB & subscription using generated scripts, I couldn't apply the snapshot for
merge publications. I got the error:
"Source: Merge Replication Provider
Number: -2147200976
Message: The subscription could not be initialized using an initial snapshot
because one or more tables in the subscription belong to another publication,
and therefore cannot be dropped. Consider initializing the subscription
manually without using a snapshot."
So I stood there with TestDB_1 working and TestDB_2 couldn't initialize. I
tried to change publication & subscription properties, article properties, I
even dropped and recreated the publications and subscriptions - but I
couldn't make the snapshot to work on TestDB_2. Even more, I cannot do that
in TestDB_1 anymore!!!!
I don't write here all the parameters that I've changed, because there are a
lot of them - maybe only one or two of them are important?

Can this be accomplished or I've only dreamed about that replication
structure working?

I would appreciate any help, Thank you

Vijay TS
3/28/2006 1:06:02 PM
Publishing same table in multiple publications is not an issue. But the
issue is when the same tables are replicated to same subscriber. Basically a
subscriberDB cannot have a table published from two merge publications. If
that is what you want can you put them in one publication?
--
“This posting is provided "AS IS" with no warranties, and confers no rights.”


[quoted text, click to view]
Adami DevOn
3/29/2006 1:02:02 AM
Thank you for your reply,

The issue is that I need the WHOLE data from those tables I mentioned before
(A, B & C), but this tables are also used in the chain defined for filtering
data with extended joins starting with the SUSER_SNAME dynamic filter.

All I could think of is to make duplicated tables of those 3 tables in the
DBs (updated with triggers from original tables only at HQ), and to use them
just for replication (not for the front application).
This seems to be the simplest solution (tables are relatively small & I
don't have to change the front application). If anyone have another solution,
I'd be happy to hear it.

Thank again,
DevOn



[quoted text, click to view]
AddThis Social Bookmark Button