How to delete the top ‘X’ rows from a table using SQL Server 2008?
24th November 2014 - HTML
To delete the top ‘X’ rows from a table using SQL Server 2008 / MSSQL for specific ordering criteria deleting from a CTE or similar table expression is the most efficient way. This can be achieved as follows:- ;WITH CTE AS ( SELECT TOP 1000 * FROM [mytable] ORDER BY a1 ) DELETE FROM CTE […]