How to set and release a row lock in Sql Server 2005

  • Hello everyone,

    I need get a row in a table and lay it on a form to edit. As soon as get the row to edit, i will set a row lock on it. Time to edit may be very long and during this time, i don't want anyone use this row to edit. They can only edit this row when i release the lock on the row.

    Can i set a row lock on table and only release it when i want (i mean the lock is not released automatically by SQL server when the editting finishes, only execute the action when i demand) in Sql server 2005?

    Please help me to solve this problem!

    Thanks a lot.

  • Do not use database locking for this. You need to implement your own locking strategy.

    See this link for a writeup of your options.

    http://www.agiledata.org/essays/concurrencyControl.html



    Clear Sky SQL
    My Blog[/url]

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply