How do I modify the first 100 rows in my SQL Server database?

I need help in updating the initial 100 rows of a table in SQL Server. The table, named EmployeeTable, contains two columns: SalaryValue and JobStatus, and holds exactly 200 rows. My aim is to adjust the SalaryValue for the first 100 entries according to a specific criterion. What SQL query can accomplish this update using the equivalent of the TOP 100 clause?

Below is one sample approach:

WITH InitialRows AS (
    SELECT TOP (100) OrderID, SalaryValue
    FROM EmployeeTable
    ORDER BY OrderID
)
UPDATE InitialRows
SET SalaryValue = SalaryValue + 500;

Any guidance would be appreciated.

hey, try this update using a subquery: update EmployeeTable set SalaryValue = SalaryValue + 500 where OrderID in(select top 100 OrderID from EmployeeTable order by OrderID). might need adjustments if there’s a specific sort order.