• You may use output clause to output the affected rows back to client

    Smth like this.

    with u as (select top(1) * from ATH_SyncEntities where Status = 0 order by EntityType, ID)

    update u set Status = 1

    output inserted.Id, inserted.EntityId, inserted.EntityType, inserted.EntityOperation, inserted.Status

    btw, do you want to update only one id at a time...


    I am really sorry for my poor gramma. And I hope that value of my answers will outweigh the harm for your eyes.
    Blog: http://somewheresomehow.ru[/url]
    Twitter: @SomewereSomehow