purge and archive : is replication the solution ?

  • Hi everyone,

    I'm new in sqlserver and I was wondering if someone could help me with this problem :

    I have 2 databases : one "small" (the real time database) and one "big" (the archived database)

    The real time database receives inserted rows and i want that periodically (let's say every day) :

     - the daily inserted rows in the real time database are duplicated in the archived database

    - the rows older than one day in the real time database are deleted.

    Is replication the solution ? Or can I do it with another method (may be scripts ? )

    Thanks for your ideas.

  • You can do it with replication. When you are building your publication, and get to the select articles dialog, add the tables, then click on the browse button to the right of the tables. In the commands tab, replace what you see in the delete command with the word NONE.

    --

    Hilary Cotter

    Looking for a SQL Server replication book?

    http://www.nwsu.com/0974973602.html

    Looking for a FAQ on Indexing Services/SQL FTS

    http://www.indexserverfaq.com

     

  • I believe Hilary's answer is mostly correct, but I also believe that it will only do half the question.  It will push the new rows to the Archive database, but it won't cull the old rows out of the live data.  For that you'll need to (manually or automatically through a job) run a delete query against the live data.


    Student of SQL and Golf, Master of Neither

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply