?
Solved

Questions about ROWLOCK and Transaction Handling

Posted on 2006-11-28
5
Medium Priority
?
1,295 Views
Last Modified: 2008-01-09
Dear Sir,
  The SQL statement:
     SELECT TITLE, DESC
      FROM BAEXP_TITLE
        WITH (UPDLOCK, ROWLOCK, NOWAIT)
      WHERE COMPANY = 'ABC' AND TITLE = 'XYZ'

  Questions:
  1. Does (UPDLOCK ROWLOCK NOWAIT) without comma also work ?
  2. What is the diffrence between (UPDLOCK, ROWLOCK) and (UPDLOCK, ROWLOCK, NOWAIT) ?
  3. Does SQL Server 2000 support multiple transactions ? If so, any settings need to be done first ?

Thanks for you help!
0
Comment
Question by:daniel710624
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:imran_fast
ID: 18035376
1,  No for each hint you have to provide comman in between
2, The first one also include nowait hint along with UPDLOCk and ROWLOCK
3. Yes, No
0
 
LVL 28

Expert Comment

by:imran_fast
ID: 18035378
>>Does SQL Server 2000 support multiple transactions ?
What to you mean like multi user environment.
0
 

Author Comment

by:daniel710624
ID: 18035719
>>Does SQL Server 2000 support multiple transactions ?
>>What to you mean like multi user environment.
I mean can I start two transactions with different TransactionID at the same time?
A nested transactions looks like :
  START TRANS 1
    DO PROCESS1
    START TRANS 2
      DO PROCESS2
    IF PROCESS2 COMPLETED THEN
      COMMIT TRANS 2
    ELSE
      ROLLBACK TRANS 2
  IF PROCESS1 AND PROCESS2 COMPLETED THEN
    COMMIT TRANS 1
  ELSE
    ROLLBACK TRANS 1
0
 

Author Comment

by:daniel710624
ID: 18035738
>>1,  No for each hint you have to provide comman in between
But there was no error occured when executed the statement without comma...That confused me!
So, (UPDLOCK, ROWLOCK, NOWAIT) is the correct one!
0
 
LVL 28

Accepted Solution

by:
imran_fast earned 2000 total points
ID: 18036344
>>So, (UPDLOCK, ROWLOCK, NOWAIT) is the correct one!
yes

No for such transactions it will be in a serial.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question