"HomeBrew" <HomeBrew@discussions.microsoft.com> wrote in message
news:582163AF-EEC9-4633-B723-70D2B72C9E1A@microsoft.com...
> I'm just using regular Transactional Replication.
>
> Is there some better filter logic I can use to avoid orphans ?
>
> "Hilary Cotter" wrote:
>
> > if you are using merge replication have a look at join filters.
> >
> > --
> > Hilary Cotter
> > Looking for a SQL Server replication book?
> >
http://www.nwsu.com/0974973602.html > > "HomeBrew" <HomeBrew@discussions.microsoft.com> wrote in message
> > news:29A8C1EA-42EC-40DE-873F-5F01C2FEBAFE@microsoft.com...
> > > I have an order header we'll call HEADER and detail we'll call DETAIL
> > > (catchy names !!)
> > > When I replicate new orders, I use filters:
> > >
> > > The HEADER article filter is like:
> > > Select * from HEADER
> > > where ordr_dte >= '1998-01-01'
> > >
> > > then
> > > The DETAIL filter is like:
> > >
> > > Select * from DETAIL
> > > where exists (SELECT * FROM HEADER WHERE DETAIL.ord_num =
> > HEADER.ord_num
> > > and (HEADER.ordr_dte >= '1998-01-01' ))
> > >
> > > This makes sure I only get DETAILS that match filtered HEADERS.
> > >
> > > Everything's fine so far. Subscriber matches Publisher
> > >
> > > Now, our order processing application sometimes deletes order records.
Not
> > > very often, but if a transaction is backed out before being posted or
> > > something.
> > >
> > > Anyway, the problem is that on the Publisher, the application deletes
the
> > > HEADER record, which gets deleted on the Subscriber ..... FINE
> > >
> > > Then the DETAIL gets deleted on the Publisher ..... BUT .... since
my
> > > filter only deals with DETAILS that have an associated HEADER, and the
> > HEADER
> > > doesn't exist any more, I'm left with an orphan DETAIL record on the
> > > subscriber.
> > >
> > > What should I do ?? Is there a better way to set this up to start
with ?
> >
> >
> >