Cathy
2013-05-14 16:22:19 UTC
I have an audit table of which one of the columns is named [when] and
defined as datetime
somebody has neglected doing maintenance on this table for several years now
and it has grown to a huge proportion
I have a script that will delete entries older than a specified date. due to
the large amount of entries, it is recommended to only delete around one
months data at a time and to run this out of hours.
To save me having to go in every night and change the value every day and
then scheduling it to run that night, I thought I would try and write a
script that could be scheduled every night to delete one months worth of
data.
When only 6 months worth of data remain, the script must continue running on
a nightly schedule but then only delete data older than six months.
In order to do this I have
defined as datetime
somebody has neglected doing maintenance on this table for several years now
and it has grown to a huge proportion
I have a script that will delete entries older than a specified date. due to
the large amount of entries, it is recommended to only delete around one
months data at a time and to run this out of hours.
To save me having to go in every night and change the value every day and
then scheduling it to run that night, I thought I would try and write a
script that could be scheduled every night to delete one months worth of
data.
When only 6 months worth of data remain, the script must continue running on
a nightly schedule but then only delete data older than six months.
In order to do this I have