title: How to handle parallel bulk update requests in SQL Server?
body: <p>Let's say I have a table storing tasks, which can have a state like 'to do', 'processing' and 'done'. As I have multiple clients taking care of processing those tasks, I want to make sure that there's just one client grabbing a certain task to process it.</p>
  
  <p>In order to avoid too many database requests a client gets multiple (10,100,...) tasks to be processed in one request.</p>
  
  <p>What's the best way to acheive this in SQL Server?</p>
  
  <p>Can I somehow select tasks to be done and update them at the same time to mark them as 'processing'?</p>