How to limit sql server table to 100,000 rows max I know that this is impossible but still need a solution.
I need to limit the number of rows in a table to 100,000 - having rows moderated by a datetime2 column. Newest rows come in, the old ones disappear.
This way I will not have to write a batch task that periodically deletes the unneeded rows.
Also the solution needs to be deployed into a production environment where there are 1,000,000 rows already and it will have to delete the existing ones.
The best solution is to &quot;write a batch task that periodically deletes the unneeded rows.&quot;