How do I modify the first 100 records in SQL Server?

I need to change the data in the initial 100 entries of a SQL Server table. In my scenario, there is a table named RecTable that contains the columns FieldOne and FieldTwo with a total of 200 records. My goal is to update the FieldOne column for the first 100 rows. How can I structure my query to update these records using a method similar to TOP 100?

Below is an example of a revised code snippet:

UPDATE rec
SET rec.FieldOne = 'ModifiedValue'
FROM (
    SELECT TOP 100 *
    FROM RecTable
    ORDER BY recID
) AS rec;

hey, u might try a version using a subquery. for instance, update recTable set FieldOne = ‘ModifiedValue’ where recid in (select top 100 recid from recTable order by recid). works good for this kind of update.

hey, i tink a common way is using a cte with row_number() to identify the first 100 and then update using that alias. ever tried that method? it might offer a bit more clarity and control in larger datasets