Is it possible to set up the MS SQL-Server to delete the oldest rows from a table when it grows too large? If not, should I use some sort of trigger or should this be a timed event in the application side?
My situation is that I have just implemented a logging solution for a web application. It is a requirement to log a lot of information, so the database will grow too large in a year or so, and I have a feeling that there will be nobody to maintain the database. Looking for the best solution for this problem.
Rather than trying to determine ahead of time what too large is, I would suggest that you define a business rule somewhere (stored procedure, configuration table, etc) that can be set to control how many days worth of logging to keep.
You can then schedule a job to run nightly through SQL Server that will delete all log records older than the specified criteria.
This way, you and your users will know exactly what to expect from the logging system (i.e. you will only have access to the log files for 30 days).
If you combine this with a regular backup strategy, then in the event that older records are needed, they could be retrieved from backups.