-
October 14th, 2005, 12:55 AM
#1
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
-
October 14th, 2005, 01:54 PM
#2
Re: Locking of a record in SQL Server SP
I think you need to set transaction isolation level to repeatable read.
-
October 15th, 2005, 12:09 AM
#3
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.
-
October 17th, 2005, 12:14 PM
#4
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)
-
October 17th, 2005, 04:00 PM
#5
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.
-
October 17th, 2005, 04:38 PM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|