Update x Rows not working

ino_mart

Registered User.
Local time
Today, 07:15
Joined
Oct 7, 2009
Messages
78
All

I use next SQL-command in MS SQL 2008 to update the top 1 record of my table. However, all records with FK=826 and status='' are updated.

Code:
update tblO set Status='In', Oms='20331266' where fk in (select top 1 fk from tblO where status='' and fk=826)

Does someone have a solution?


Regards
Ino
 
I found the solution. Seems it is as simple as
Code:
update top(1) tblO set Status='In', Oms='20332055' where status='' and fk=826
 

Users who are viewing this thread

Back
Top Bottom