I have the following table below and am trying to update the first available row with an user ID through a query, but I need to limit this to only update one row and not multiple.
ID Model UserID
1 X12T5 1
2 X13T5 2
3 X14T5 NULL
4 X15T5 NULL
UPDATE Table SET UserID = '3' WHERE UserID IS NULL
You can do this with
UPDATE TOP. It's the equivalent of a
SELECT TOP but for updates; and
TOP is SQL Server's equivalent of MySQL's
See further info.