SQL Server Performance

Deadlock while using cursor

Discussion in 'General Developer Questions' started by nitingulati7, Sep 23, 2004.

  1. nitingulati7 New Member


    It happened that i had to use a cursor, but this is leading me to a deadlock.

    What am i trying to do:
    I have created a sp_test1 that has following steps:
    1. I have Transaction begin transaction for sp_test1
    2. In this transaction i have created a cursor but this cursor is holding only one record that is being deallocated.
    3. Inside the loop of the cursor I am calling another stored procedure "exec sp_test2"
    4. In sp_test2 there is a being and end transaction.
    5. final end of the transaction of sp_test1

  2. satya Moderator

    http://www.sql-server-performance.com/deadlocks.asp - one of the tip here stated was avoid Cursors which will lead to deadlock, refer to the link for more information.


    Satya SKJ
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  3. nitingulati7 New Member

    I want to know that how can i replicate this situation. cause i am using a cursor but what i have take that in READ ONLY mode..

    info that i need is what is that is missing are the resources low or something else.
  4. nitingulati7 New Member

    How can i see the exact cause of deadlock.

Share This Page