|
|
 |
Re: FN-FORUM: Suggestions please
date posted 15th August 2003 16:02
> I am writing a timesheet at the moment and I want to make sure that
> noting over 5 years old is kept on the database. The only way I can think
of
> is going through and deleting everything over five years old every time
> someone logs in to the system which could be more than once a day.
> especially on a Friday. Can anyone think of a way of only doing it once a
> day please.
If it's on a *nix box you could use a CRON job if the host supports them.
If it's an internal windows box that you have access to, you could set up a
Windows Scripting Host file that does the job and set up a scheduled task to
run every day.
If the database is MSSQL and you have access through Enterprise Manager (and
can create new jobs) you could set up a job in SQL Server Agent to run your
SQL.
Personally though, having used all these methods in the past, I'd remove the
records when someone logs in. There aren't going to be many records to
remove each time and the running of the query should be barely noticable -
and you *know for a fact* that the query will get run.
Andy
|
 |
|