Hi,
I want to create trigger in SQL server that removes record which are older than one week.
I have date field in table, after inserting record in this table, it should automatically removed from table after one week. I want trigger to create trigger for that.
So help me how to create such trigger that fires after some time interval.
Thanks.
Trigger that removes data older than one week
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 3, 2013, 8:25 PM EDT
hi,
Agree with Javeed,
you may use SQL JOB. this SQL job is not available in SQL express edition.
if you are SQL express edition use the you can create console application and this application is run by windows Scheduler.
please refer for SQL Job
http://msdn.microsoft.com/en-in/library/ms191439%28v=sql.100%29.aspx
http://windows.microsoft.com/en-in/windows7/schedule-a-task
hope this will help you.
Javeed M ShaikhRank #839 · 2.7K reputationPosted Apr 3, 2013, 1:06 PM EDT
Instead of a trigger which will fire on every event, I would suggest you create a job which will run against this table and delete data which is older than a week. You can have this job run everyday during a quite time.