Home Forums SQL Server 2012 SQL 2012 - General DELETE FIRST 1000 ROWS RE: DELETE FIRST 1000 ROWS
gstarsaini
Ten Centuries
Points: 1010
More actions
March 31, 2014 at 1:11 am
#1701481
You can use row number () to create ids for all the rows and then based on any column order you can delete 1000 rows:
DELETE FROM
(SELECT ROW_NUMBER()
OVER (ORDER BY Empcode) AS Row,
Name, Address, Idno
FROM Table_name) AS tablename
WHERE Row<=1000