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;