Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2004
    Posts
    3

    Unanswered: Convert DB2 "FOR UPDATE" in SQL Server

    Hello,

    In DB2, we can do FOR UPDATE selection, in order to lock the records until the transaction is completed. e.g.

    select field1, field2, field3
    from table
    FOR UPDATE;

    How can I perform the equivalent feature in SQL Server?

    Thanks!

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    This is an exceptionally bad way to do things. It allows the "lunchtime lock" where a user has data locked for ages, preventing others from getting any real work done. The best way to simulate this feature in SQL Server is to retrieve the data, then turn off or unplug the network cable from the server.

    -PatP

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Pat...Pat...Pat....

    You've worked on big iron before.....
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by Brett Kaiser
    You've worked on big iron before.....
    I know, I'll admit it... but I keep trying to prevent those bad habits from spreading!

    -PatP

  5. #5
    Join Date
    Oct 2004
    Posts
    3

    why you want to make fun of me?

    I sincerely need helps for this question. And I am not fooling around here.

Posting Permissions

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