SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Deleting records older than a year!!

 
Reply to topic    SoftTree Technologies Forum Index » DB Audit, DB Mail, DB Tools View previous topic
View next topic
Deleting records older than a year!!
Author Message
shashank



Joined: 26 May 2005
Posts: 4

Post Deleting records older than a year!! Reply with quote

Hello friends!
can somebody tell me how i can delete records from database which
is older than year and doing so what care should
i have to take about database. Database is SQL SERVER2000
can tell me stored procedure

somebody help me out

thanks!!

Thu May 26, 2005 1:44 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7839

Post Re: Deleting records older than a year!! Reply with quote

You must have some date column in the table where you want to delete old records. You can calculate the difference between the system date and valus in that column and delete records having the difference > 365 days.

To calculate the difference use DateDiff(d, [date column name], GetDate()) expression in the WERE clause of the DELETE statement.

: Hello friends!
: can somebody tell me how i can delete records from database which
: is older than year and doing so what care should
: i have to take about database. Database is SQL SERVER2000
: can tell me stored procedure

: somebody help me out

: thanks!!

Thu May 26, 2005 2:26 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » DB Audit, DB Mail, DB Tools All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.