Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what lock datarow mean?

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hi,

I need to add some more columns for my existing table, however, when I copy the code from a table, there is a row say "lock datarows" at the end of the creating table.
I would like to know what that line doing? Does it mean that why I am alter the table, I need to lock the row of that table preventing users from interferring with my work?
Thanks
 
No this means that your table is using row level locking as opposed to all page locking which is the default. You can put a table in row level locking by doing

alter table <TABLE_NAME> lock datarows -- make sure that you have enough space when you do this in your database

or put it back to page level locking by doing

alter table TABE_NAME lock allpages

Row level locking improves performance.
When you alter a table by adding a new column, table is locked until column is added, so nobody except you will be able to use it for that second

I hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top