Solved

Questions about ROWLOCK and Transaction Handling

Posted on 2006-11-28
5
1,271 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
  • 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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

856 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