Delete All Rows From a Table Except Top(N) Rows

This script contains all code blocks within TechNet Wiki article T-SQL: Delete All Rows From a Table Except Top(N) Rows written by Saeid Hasani. This article 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)

 
 
 
 
 
5 Star
(1)
210 times
Add to favorites
Databases
1/3/2015
E-mail Twitter del.icio.us Digg Facebook