views:

670

answers:

3

Is there some means of querying the system tables to establish which tables are using what locking schemes? I took a look at the columns in sysobjects but nothing jumped out.

A: 

take a look at the syslockinfo and syslocks system tables you can also run the sp_lock proc

SQLMenace
+1  A: 

aargh, just being an idiot:

SELECT    name, lockscheme(name)
FROM      sysobjects
WHERE     type="U"
ORDER BY  name
ninesided
A: 

The recommended way is to query the dynamic management view (DMV):

select * from sys.dm_tran_locks
Mitch Wheat
Mitch, that might be true for SQL Server, but it doesn't work for Sybase ASE. The answer above should be correct for all T-SQL variants. Out of curiosity, what does the DMV do for me that sysobjects doesn't? Aren't they just views on the same underlying system data?
ninesided