|
Question : How can i delete old records automaticaly?
|
|
Greetings Experts.
I want to clear old records ( eg PM's) from my database every Month , automaticaly. The way i do it right now is a Windows Task running a vbs file.
But i want to be done automaticaly by the Sql? is there a way? Thank you in advance.
|
|
Answer : How can i delete old records automaticaly?
|
|
sure...just put this statement into a SQL Agent job....schedule it to run whenever you want...it will only delete records older than 30 days.
delete MemberMessages where datediff(d, date_a, getdate()) > 30 -- delete records older than 30 days
|
|
|