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
 General SQL Server Forums
 New to SQL Server Programming
 select records in groups

Author  Topic 

CrazyT
Yak Posting Veteran

73 Posts

Posted - 2010-07-16 : 19:39:47
i have a problem where i am trying to grab a group of records and mark them in use so that they are not assigned again while they are being worked on

my problem is that thread 1 comes by grabs its records and flags them as in use. what i want is for the next thread to get the next group of records

what is happening is when the threads start up the first threads gets its 5000 records and the second one gets its 5000 which may include some of the records from the first group one becuase the update hasnt completed flagging them as in use.

how do you get around this?

Kristen
Test

22859 Posts

Posted - 2010-07-17 : 01:46:29
I use a batch number, rather than a flag
Go to Top of Page
   

- Advertisement -