Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2011
    Location
    Braga, PORTUGAL
    Posts
    1

    Question Unanswered: Concurrent SQL Update

    I need to perform an Update in one specific table. To avoid concurrent updates, i perform a validation in each update statement.

    Table fragment:
    -----------------------------------
    Order int not null,
    Requested bit not null,
    Status varchar(20) not null, ...
    -----------------------------------

    My update is:
    UPDATE TableName SET
    Status='IN ORDER',
    Requested=1
    WHERE (Order= [order number] AND Requested=0)


    I do this for each row that is being updated, all inside a transaction.

    What I need is: For each row that is not updated (condition fail - Requested=0) i need to get the order number to return back to user.
    Does anyone have an idea?
    Thanks in advance.
    Last edited by Palmeiras; 04-27-11 at 21:44.

Tags for this Thread

Posting Permissions

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