SQL Server Performance

Archive Automation

Discussion in 'SQL Server 2005 General DBA Questions' started by Edy, Apr 24, 2011.

  1. Edy New Member

    I need to pull the database older than 60 days.Can somebody please help me with a script to do that.
    Thanks for your help in advance!
  2. Luis Martin Moderator

    Welcome to the forums!.
    Automatic script?
  3. FrankKalis Moderator

    What exactly do you mean by "pull the database" please?
  4. Madhivanan Moderator

    select * from table
    where date_col>=dateadd(day,-60,getdate())
  5. Jahanzaib Member

    Create Archive Database and then create a archive table as you want then write a query as
    INSERT INTO archivedatabase.dbo.archivetable
    SELECT * FROM sourcedatabase.dbo.sourcetable
    where datecolumn <= getdate()-60

Share This Page