Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 SQL Job

Author  Topic 

sqlpal2007
Posting Yak Master

200 Posts

Posted - 2008-12-11 : 09:37:02
Hello All,

I have to write a sql job which would run on every first day of the month and move the records which are greater than 1 year to an archive table. For example if the job is running on 03/01/2009, the table should copy the data < 03/31/2008 to archive table. It should take care of the leap year as well.

Can some one assist me to write SQL for it?

Thank you,
-P

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-11 : 11:34:50
Have you looked at Table Partitioning feature if you have Enterprise Edition?
Go to Top of Page

sqlpal2007
Posting Yak Master

200 Posts

Posted - 2008-12-11 : 11:45:03
No I do not know about this feature. I have Enterprise Edition installed.

Thanks,
-P
Go to Top of Page
   

- Advertisement -