Results 1 to 2 of 2

Thread: Do SQL Cursors lock the tables?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2013
    Posts
    985

    Do SQL Cursors lock the tables?

    im just trying to get some info on this and im getting lots of feedback that is a little confusing.

    If i have a simple SP with say 2 nested cursors (dont shout) and all they are doing is building a report table say (not making changes to tables) will the tables opened in these cursors be locked during the operation?

    these cursors are running on default settings, no read-only or other settings are used before the cursors.
    Yes!!!
    Working from home is so much better than working in an office...
    Nothing can beat the combined stress of getting your work done on time whilst
    1. one toddler keeps pressing your AVR's power button
    2. one baby keeps crying for milk
    3. one child keeps running in and out of the house screaming and shouting
    4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
    5. working at 1 O'clock in the morning because nobody is awake at that time
    6. being grossly underpaid for all your hard work


  2. #2
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,834

    Re: Do SQL Cursors lock the tables?

    If you are not changing the defaults I believe it is the same as any other select statement. Part of the big picture depends on database settings for transaction locking.

    https://technet.microsoft.com/en-us/...=sql.105).aspx
    Last edited by TysonLPrice; Jan 31st, 2018 at 10:12 AM.
    Please remember next time...elections matter!

Posting Permissions

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



Click Here to Expand Forum to Full Width