Relative Content

Tag Archive for sql-serverdatabaselocking

Will using a transaction on my SQL server prevent another host from being able to read rows in the table?

Suppose I have a table that is constantly being updated with tasks to be processed. One column in this table is status and when a task is first entered into the table, status = ‘submitted’, when a host is processing the task, it changes status to ‘processing’ and when the data processing for the task has been completed, it updates status to ‘completed’. I will have multiple hosts that will be accessing this specific table to check to see if a task has been added. Currently this is the code that I have: