Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Table to be locked for only user at a time

Author  Topic 

kamalkishore_in
Yak Posting Veteran

76 Posts

Posted - 2002-03-04 : 01:24:10
Hi,

I wants to know that how can I lock a table to be used by only one user at a time and after some processing unlock that table
using Visual basic 6.0 and SQL Server 2000.
Lock for reading, deleting, or updating.


Nazim
A custom title

1408 Posts

Posted - 2002-03-04 : 01:41:10
You dont have to worry about the front end you are using to do this kinda stuff offcourse if you are doing it via Stored procedure and tht's the best way.

Check for Tablock in BOL. it might help you.

eg:
select * from tablename (tablockx, holdlock) will hold the lock until the query is processed

you can check
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE this will also make your system serializable . but then will hit badly on your performance.

HTH

--------------------------------------------------------------


Edited by - Nazim on 03/04/2002 02:44:44
Go to Top of Page
   

- Advertisement -