Results 1 to 3 of 3

Thread: Concurrency

Threaded View

  1. #1

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width