Automatic delete | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Automatic delete

Hey all, I am a noob. I have 1 table that needs to have records deleted from it when the "ExpiryDate" field is past the current date/time. This automatic delete needs to happen once every hour. What would be the best way to approach this? THANKS!!!
I would create a simple delete statement and put it in a job that runs every hour. This would take care of it quite simply Chris
Thanks Chris! Are there any links you know of that can give me some example code on this to get me started. Thanks!
Something like:
delete table_name where column_date <= Getdate(). You can run a schedule job each our (Entreprise Manager, New Job, Schedule). Luis Martin
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.
]]>