I would like to lock a table to only allow users to perform read operation in Sybase ASE 15.5, how can I do it? I have tried the below command, but seems there is some confusion. Any idea?

Session A: Perform below commands and after that try to perform insert operation. New records can still insert into locked table (but I think it is not commit the transaction yet). Can still select record from the locked table.

begin transaction
lock table testB in share mode

Session B: Cannot select data from the locked table.

2 Answers 2


I think you should look at locking mechanism of table, there are three types of them - AllPages, Datapages and Datrows, you can read more about them at:

Locking Mechanism in Sybase

If you alter locking of table, update/delete and select can take place together without any blocking on mentioned table.

Inside query, you can put noholdlock on a table or other options for other users to access/no access based on these options as mentioned in below link:

Controlling Isolation

In order to answer your question in detailed level, we need to have more clarity on question. Your question doesn't explain details of issue. I hope above helps.


If you dont want users to insert data to a table - remove the rights of insert/update/delete on this table.

Locking a table within transaction act differently, it depends on what kind of lock scheme it have etc etc.

Elaborate your scenario in detail.

Meantime check this http://infocenter-archive.sybase.com/help/index.jsp?topic=/com.sybase.dc33621_33620_33619_1250/html/ptallbk/X20061.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.