Michael Miller wrote:
Thanks Sebastian...seems the server is timing out before it can complete operation. Never just one thing.
Michael,
when the statement is timing out you have two options:
- either you try to enter Sebastians code as long as it works (I guess that some records get deleted every time and somewhen it is done)
- or you reduce the amount of records to delete by adding a date range condition.
For the second option, you could try to delete all records in the first half year of 2014 by
DELETE FROM {databaseOwner}{objectQualifier}EventLog WHERE LogCreateDate BETWEEN CONVERT(date, '2014-01-01') AND CONVERT(date, '2014-06-30')
If this works, change the dates and delete the second half year of 2014, etc., otherwise take only the first quarter.
To determine how many records are in a specific time range, you can use:
SELECT COUNT(*) FROM {databaseOwner}{objectQualifier}EventLog WHERE LogCreateDate BETWEEN CONVERT(date, '2014-01-01') AND CONVERT(date, '2014-06-30')
Happy DNNing!
Michael