Locking question!

  • Hi all,

    I have question that how can i lock database records such a way that if one user is accessing the record at that time other user can access the same record but can't make any changes it goes in read only mode! how can i perform that in SQL Server.

    Thanks

  • You can start a transaciton that locks the record, but that is not the proper way to deal with rows in SQL Server. In general, if you want to prevent an update, then you want to raise some sort of semaphore the record that lets the application know that this record is in use and should not be changed.

  • Could you elaborate more on how you can raise that semaphore stuff and how exactely it solves the problem.

    Why I am asking this is because I have a very large table and there is a field on which there is no indexing mentioned(applied). Now, if many users do a select the database table is locked and for a user who wants to do an update can't do this unless all of the selects have been done. Can there be a better solution for this?

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

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