I want to update the top 100 records in SQL Server. I have a table T1
with fields F1
and F2
. T1
has 200 records. I want
for those like me still stuck with SQL Server 2000, SET ROWCOUNT {number};
can be used before the UPDATE
query
SET ROWCOUNT 100;
UPDATE Table SET ..;
SET ROWCOUNT 0;
will limit the update to 100 rows
It has been deprecated at least since SQL 2005, but as of SQL 2017 it still works. https://docs.microsoft.com/en-us/sql/t-sql/statements/set-rowcount-transact-sql?view=sql-server-2017