T-SQL: Delete All Rows From a Table Except Top(N) Rows

I added the article which comes from a question that asked in MSDN forum. The problem is how to delete all rows from a table but remain the Top (N) rows, for example, remaining only the top (1000) rows. All Code samples in this article are downloadable from this   link . Please navigate to this link