Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

FIFO queue table for multiple workers in SQL Server

You need exactly 3 lock hints

  • READPAST
  • UPDLOCK
  • ROWLOCK

I answered this previously on SO: https://stackoverflow.com/questions/939831/sql-server-process-queue-race-condition/940001#940001

As Remus says, using service broker is nicer but these hints do work

Your error about isolation level usually means replication or NOLOCK is involved.

Tags:

Sql Server

Queue

Locking

Related

Parallel Statistics Update Generate create script for all indexes Can MySQL reasonably perform queries on billions of rows? Trigger to UPDATE after UPDATE? Create function in central database or repeat in each database? MySQL Set UTC time as default timestamp Daily database maintenance using SQL Server 2008 and a stored procedure How does SQL Server choose an index key for a foreign key reference? Possible to keep max number of records in postgresql? Parameter sniffing work arounds Dynamically Define a Range in a Dimension SQL Server how to get around the transaction log filling up when updating a column to an int

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy