sql - Is there a way to SELECT and UPDATE rows at the same time? -


I want to update a set of rows based on a simple criteria and am getting a list of PK that will change I thought I could do something like this, but I am probably worried about the problems of concurrency:

  Select from Table 1 ID where there is an AlertDet Null; Update Table 1 SET AlertDate = getutcdate () where AlertData is faucet;  

If he is wrapped in a transaction, can there be any concurrent problems? Or is there a better way to do this?

(Even DELETE and INSERT ). Example from Linked MSDN page:

Update Top (10) Human Resources Employee Employee SIT Holidays = Vacation House * 1.25, Modified Date = Gateet () Output is inserted. BusinessIndIIDID, Deleted.VinehouseHouse, Inserted.VinehouseHouse, Incorporated Date modified on @MyTableVar;

Comments