Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2005
    Posts
    2

    Unanswered: Help Req with Locking Tables...

    Hi DB Gurus..

    I need to lock one table ( table-level locking) as i dont want anyone to modify till i finish my stored procedure.

    I need simple example on how to Lock the table and unlock..

    Something like this

    Lock Table Name...
    ...

    statements go here
    ...

    Unlock table...

    Is this possible in Sql server 2000

    waiting for ur replies..

    Thanks in Advance

  2. #2
    Join Date
    Oct 2003
    Posts
    357
    I dont know whether this is efficient method


    begin transaction

    ...

    statements go here
    ...


    Commit transaction
    Madhivanan

    Failing to plan is Planning to fail

  3. #3
    Join Date
    Mar 2005
    Posts
    2
    Hey Guys..

    anymore suggestions...

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Whenever I see anyone suggest locking a table, the first thing that comes to my mind is to stop SQL Server, then restart it in single user mode. While some folks consider this a bit drastic, it has about the same effect on scalability, it is far more efficient, and it is less uncertain.

    -PatP

Posting Permissions

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