Delete records older than a certain period from the subscriber
From: Janez (janezcas_at_yahoo.com)
Date: 12/08/04
- Next message: Larry: "Re: Missing Transactions - REPOSTED."
- Previous message: RML51: "Re: Can't get rid of distribution db"
- Next in thread: Hilary Cotter: "Re: Delete records older than a certain period from the subscriber"
- Reply: Hilary Cotter: "Re: Delete records older than a certain period from the subscriber"
- Messages sorted by: [ date ] [ thread ]
Date: 8 Dec 2004 07:03:23 -0800
Hi,
I am struggling with this for some time now:
I want all records older than a certain period (eg. one month) to be
deleted from the subscriber's database.
I have created sample database with only one table and one datetime
column, just for testing this. The table is filtered:
SELECT <published_columns> FROM [dbo].[table] WHERE DateField >=
DateAdd(month,-1,GetDate()) - so subscriber should only have records
entered last month.
So, if subscriber enters one record in the subscription db with
today's date and synchronizes immediatelly, record will remain in the
subscriber's database which is OK, but I want this record to be
removed from the subscriber's database when user will synchronize
someday in the future and this record will be older than a month.
However, this does not happen. I know that record won't be sent to the
publisher as a part of merge replication, if it was not changed
between synchronizations. For that reason, an update to the same value
is always performed on the subscriber's table before the
synchronization, eg. update table set datefield = datefield.
I can see in the merge agent history that this update is sent to the
publisher, but record still remains in the subscriber's db. It seems
to me that filter is not evaluated correctly or not evaluated at all.
If I specify reinitialization on the subscription, the record is
removed from the subscribers database, but I do not want to
reinitialize at each sync.
I have read numerous posts and noticed that this scenario should
work?!
Any idea what might be wrong?
I am using SQL 2000 with SP3.
Janez
- Next message: Larry: "Re: Missing Transactions - REPOSTED."
- Previous message: RML51: "Re: Can't get rid of distribution db"
- Next in thread: Hilary Cotter: "Re: Delete records older than a certain period from the subscriber"
- Reply: Hilary Cotter: "Re: Delete records older than a certain period from the subscriber"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|