Sunday 19 September 2004

SQL Statement to purge logs over 7 days old

I searched for sometime to find this one.  Needed to clear some IIS HTTP and Exchange 2003 SQL logs.  Finally found this SQL statement that would do it:

DELETE FROM inetlog
WHERE LogTime < dateadd (day, -7, getdate() )

No comments:

Post a Comment