Answer the question
In order to leave comments, you need to log in
How to limit the number of entries?
There is a table for logging records, how to make sure that records older than one month are deleted relative to the last record?
Answer the question
In order to leave comments, you need to log in
For sampling:
SELECT
*
FROM logTable
WHERE logTable.date > DATEADD(month, -1, (SELECT MAX(logTable.date) FROM logTable))
DELETE
FROM logTable
WHERE logTable.date <= DATEADD(month, -1, (SELECT MAX(logTable.date) FROM logTable))
Create a task that will run a query with the removal of old entries and add it to the task scheduler for daily execution.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question