Showing posts with label merge. Show all posts
Showing posts with label merge. Show all posts

Friday, March 30, 2012

Multiple joins in a filter

I'm using Sql 2005 and merge replication.

I want to create a dynamic merge filter on a table but the data I filter on is only reachable by a few extra joins. For example:

I want to filter Table3. Table3 is joined to Table2 which in joined to Table1. Table1 contains the host_name column that I use to filter i.e. host_name = HOSTNAME().

In order to get filtered data in Table3 do I have to also filter Table 2 and Table1, or in my filter clause for Table3 can I say something like: Table3.FKid = Table2.Id and Table2.FKId = Table1.Id and Table1.host_name = HOSTNAME()?

I'm pretty sure I can't use AND in my dynamic filter clause but I just wanted to make sure.

Thanks for your help

Graham

The recommended way would be:

1. On T1: myFilterColumn=HOST_NAME()

2. On T2: add a join filter with sp_addmergefilter - T2.c1=T1.c1

3. On T3: add a join filter with sp_addmergefilter - T3.c3=T2.c2

Monday, March 12, 2012

multiple database publications

I'm using merge replication with sql2000 and sqlserverce. All is working
well for now.
My customer now wants my ppc app to utilize data from multiple databases. Is
it possible for a single publication to contain data from multiple databases
and if so will it merge correctly?
This is probably a stupid question, but it would be nice if it works
I'd have to try this out, but I don't think so. You replicate to SQL CE
using an ActiveX control on the PPC which will pull the subscription to the
PPC.
One option you may have is to use RDA to do parts of your sync, and a merge
publication to do other tables.
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"mgarner1980" <mgarner@.kbsi.com> wrote in message
news:OOYLbvPzEHA.804@.TK2MSFTNGP12.phx.gbl...
> I'm using merge replication with sql2000 and sqlserverce. All is working
> well for now.
> My customer now wants my ppc app to utilize data from multiple databases.
> Is
> it possible for a single publication to contain data from multiple
> databases
> and if so will it merge correctly?
> This is probably a stupid question, but it would be nice if it works
>