CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Location
    India
    Posts
    24

    Arrow Locking of a record in SQL Server SP

    Hi,

    IF user1 is accessing a row ,this particular row should not be accessed by other users.Only when the lock is released (After user1 completes his processing with that row) that row should be accessible by others.The locking of a row has to be done at the selection of a particular row(Has to be done in select statement).

    This is an SP level coding where commands between the begin trans and commit trans will only appear .The begin trans and commit trans functionalities are done by DLL's which cannot be changed.
    Last edited by trends; October 14th, 2005 at 12:56 AM. Reason: Spelling

  2. #2
    Join Date
    Apr 2005
    Posts
    576

    Re: Locking of a record in SQL Server SP

    I think you need to set transaction isolation level to repeatable read.

  3. #3
    Join Date
    Oct 2005
    Location
    India
    Posts
    24

    Talking Re: Locking of a record in SQL Server SP

    Hi,

    Thank you for the reply.But we cannot change the transaction isolation level since in is built in dll.is there any other way to achieve this.We can only change the sp code.

  4. #4
    Join Date
    May 2004
    Location
    London, England
    Posts
    563

    Re: Locking of a record in SQL Server SP

    If you have access to the SQL, then you can add a TABLOCKX hint as part of your query, as in:

    Select * from record (TABLOCKX) where cust_ID = @value;

    Other than that, depending on what language you are using, I'd setup read and write events and possibly 'critical sections'.

    Regards

    John
    I don't mind that you think slowly but I do mind that you are publishing faster than you think. Wolfgang Pauli, physicist, Nobel laureate (1900-1958)

  5. #5
    Join Date
    Oct 2005
    Posts
    15

    Unhappy how to update a picture in a sql database

    HI, i am having problems updating picture i store in a sql 2000 server once there are more than 10 pictures stored.

  6. #6
    Join Date
    May 2004
    Location
    London, England
    Posts
    563

    Re: Locking of a record in SQL Server SP

    You'll get a better response if you refrain from hijacking another person's thread.

    Regards

    John
    I don't mind that you think slowly but I do mind that you are publishing faster than you think. Wolfgang Pauli, physicist, Nobel laureate (1900-1958)

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

Featured