Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Using Table as Queue

Author  Topic 

asfars
Starting Member

1 Post

Posted - 2007-09-17 : 12:25:26
I have developed a windows service which will poll a SQL 2000 database table.
One of the columns of the table is ProcessFlag. If the Process Flag is set then I want the service to perform some calculations based on some other column values and update another table.

I can have multiple instances of windows service running and polling the same database. If one service picks up a row for processing I want the other service to start processing the next row if available immediately. What would be the best approach to do this?
Should I use table locking and lock the table and use another column to say that the row has been picked up or can I use row level locking so that the second service does not wait for the table lock to be released.

I am using C# in VS2005 and accessing data using ADO.NET.
   

- Advertisement -