Elegant

time to read 1 min | 84 words

I would let this piece of code to stand on its own. I like it.

 

UPDATE TOP (100) Messages

SET Status = 'Sending'

OUTPUT Inserted.*

WHERE Status  IN (

      'New',

      'Sending') -- we previously failed to send this message