2
pimps
166 days, 13 hours, 18 minutes ago
Sunday, October 04, 2009 1:15:28 AM GMT Saturday, October 03, 2009 4:59:39 PM GMT

Deleting All Records In a Table EXCEPT For the N Most Recently Added Records

Deleting All Records In a Table EXCEPT For the N Most Recently Added Records
 
scottonwriting.net -- I recently ran into a situation where I needed to delete all records from a table except for the 1,000 most recently added records. Specifically, I was working on a site that used Error Logging Modules And Handlers (ELMAH), a free, open source error logging library for ASP.NET applications. ELMAH doesn't automatically prune its error log. If you are using the database as a log source and if your web hosting provider has a database quota in effect, it is possible to have ELMAH's error log grow so large that the quota is surpassed and the database is taken offline.
hismightinesshismightiness posted 166 days, 21 hours, 34 minutes ago     show counter code
tags: sql, sql server, T-SQL

No comments yet, be the first one to post comment.

To post your comment please login or signup