ROWLOCKS and Indexes

ROWLOCKS and Indexes

Post by Agus » Thu, 13 Dec 2001 21:46:15



Hi all!

   We're working with ADO and SQL-SERVER 7.0, and we need to lock the
records at row level.
    We have downloaded the MS example program, ROWLOCK and we've tryed it,
it seems to work fine on the database pubs, but, when we make changes on the
indexes of the titles's table, then the locks begins to work at a page level
or table level.

    Is there anybody who can explain it to us? We have searched on the msdn
but we haven't found any kind of explication for this matter.

Wich is the relation betwens locks and indexes in SQL SERVER?

In our application we have made changes on indexes, and the best results
were reached when we created clustered indexes. But we haven't found the
explication yet.

Thanks!

Agu.

 
 
 

ROWLOCKS and Indexes

Post by Andrew J. Kell » Thu, 13 Dec 2001 22:05:04


Well the key to getting a rowlock is to ensure you have a valid Primary Key
and if you are using ADO then you must have the PK in the RS.   If there are
only a few rows in the table SQL Server may choose to lock the page but on a
typical table the PK is critical.

--
Andrew J. Kelly,  SQL Server MVP
TargitInteractive


Quote:

> Hi all!

>    We're working with ADO and SQL-SERVER 7.0, and we need to lock the
> records at row level.
>     We have downloaded the MS example program, ROWLOCK and we've tryed it,
> it seems to work fine on the database pubs, but, when we make changes on
the
> indexes of the titles's table, then the locks begins to work at a page
level
> or table level.

>     Is there anybody who can explain it to us? We have searched on the
msdn
> but we haven't found any kind of explication for this matter.

> Wich is the relation betwens locks and indexes in SQL SERVER?

> In our application we have made changes on indexes, and the best results
> were reached when we created clustered indexes. But we haven't found the
> explication yet.

> Thanks!

> Agu.


 
 
 

1. ROWLOCKS and Clustered Indexes.

Hi all!

   We're working with ADO and SQL-SERVER 7.0, and we need to lock the
records at  row level.
    We have downloaded the MS example program, ROWLOCK and we've tryed it,
it seems to work fine on the database pubs, but, when we make changes on the
indexes of the titles's table, then the locks begins to work at a page level
or table level.

    Is there anybody who can explain it to us? We have searched on the msdn
but we haven't found any kind of explication for this matter.

Wich is the relation betwens locks and indexes in SQL SERVER?

In our application we have made changes on indexes, and the best results
were reached when we created clustered indexes. But we haven't found the
explication yet.

Thanks!

Agu.

2. BCP_INIT fails

3. Difference between (HOLDLOCK) and (ROWLOCK, HOLDLOCK)

4. Can't connect to SQL6.5 thru E.M. after install or SQL2000 on win2000 wkstn

5. rowlock

6. initdb fails after installation on Mac OS X 10.2

7. 816 System Error after turning ROWLOCK on

8. TELESIS users, anyone??

9. rowlock only works for select statement?

10. RowLock

11. ROWLOCK question

12. Rowlock

13. SQL 7.0: just can't get to ROWLOCK