earthandfire
Programmer
I have a table with two fields type and number. I need to fetch the current value of number (for a given type) increment it and save it back into the table - returning the new number to the caller. However there could be several (10s or even 100s) of "simultaneous" requests for a new number.
I would like this to be handled by a Stored Procedure so that there is only one entry point to this table, but I can't see how to handle the locking.
BOL doesn't seem to help much and I've serched here but nothing seems to solve the problem.
Does anyone have any ideas?
Thanks.
![[vampire] [vampire] [vampire]](/data/assets/smilies/vampire.gif)
![[bat] [bat] [bat]](/data/assets/smilies/bat.gif)
I would like this to be handled by a Stored Procedure so that there is only one entry point to this table, but I can't see how to handle the locking.
BOL doesn't seem to help much and I've serched here but nothing seems to solve the problem.
Does anyone have any ideas?
Thanks.
![[vampire] [vampire] [vampire]](/data/assets/smilies/vampire.gif)
![[bat] [bat] [bat]](/data/assets/smilies/bat.gif)