T-Sql – Keeping Top n rows in a table

The title sounds like related to a logging operation, isn’t it? Well yes, it is.In an existing logging operation, I needed to ensure that the number of log entries remained below a specified threshhold. And I came up with the following sql quickly: DECLARE...