|
-
Sep 12th, 2022, 08:35 AM
#1
Concurrency
We have a table that has reference numbers for documents. The simplified version of this table, call it RefNum, is,
id - int - identity
refN - smallint - the reference number
available - bit - is number available
This table is pre-filled with refN's that have available = 0.
How do I write the SQL to select the next available reference number, and update it, without worrying about two users getting the same number?
Can I simply wrap the SQL statements in a BEGIN / COMMIT TRANSACTION block?
Any help is appreciated.
Last edited by dbasnett; Sep 12th, 2022 at 02:02 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|