When reading a single row, you should probably have a where
clause. Alternatively, a top
combined with order by
would be acceptable.
Bad:
select Id, Name
from Users
Good:
select Id, Name
from Users
where UserName = @cn
Also fine:
select top 1 Id, Name
from Users
order by CreationDate desc