Click here to Skip to main content
15,899,937 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Explain me about different types of lock in single select statement

How to lock the table while operation like Read-Write

How Unlock the table After DML operation over.

What type of lock should be used on table to lock and unlock and where should be used.
Posted

The SELECT statement will not lock the Table.
To lock the table, use
BEGIN TRANSACTION

Then do any action you need to do on this table.

When you are done, use:
UPDATE
and
COMMIT
 
Share this answer
 
Comments
gvprabu 8-Mar-13 23:19pm    
How Select Statement will not lock the table...?
Davidduraisamy 8-Mar-13 23:46pm    
Can you explain y lock will not work in select statement
Michael Haephrati 9-Mar-13 4:24am    
I might be wrong here. From what I checked, this is the best method to use to gain full control over the table. There might be other ways...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900