SQL Table Locks

Created by Chris Sandu, Modified on Wed, 19 Feb, 2025 at 4:13 PM by Chris Sandu

Find who is Locking a Table


Sign in to Trapper (Start, Run, mstsc, Trapper, password)


Open Microsoft SQL Server Management Studio


Highlight the database you want to count records in

New Query, you should see the database name near top

 

Paste the following in New Query in SQL for GISData (making sure that the owner name as shown under Tables, for the ownername_table_locks matches the ownername before the _process_information, _table_registry, and __table_locks portion of the script below.  Such as sde.sde for GISData or dbo.sde for GISDevelopment and OtherCVT):


select a.sde_id, a.owner, l.registration_id, b.owner + '.' + b.table_name "Table", a.nodename, l.lock_type from sde.sde_process_information a, sde.sde_table_registry b, sde.sde_table_locks l

where  a.sde_id = l.sde_id and l.registration_id = b.registration_id

order by "Table";


Paste the following in New Query in SQL for GISDevelopment or OtherCVT:


select a.sde_id, a.owner, l.registration_id, b.owner + '.' + b.table_name "Table", a.nodename, l.lock_type from dbo.sde_process_information a, dbo.sde_table_registry b, dbo.sde_table_locks l

where  a.sde_id = l.sde_id and l.registration_id = b.registration_id

order by "Table";


Execute

See Results window

If users have one item from a dataset open, it shows that they have every item from that dataset locked.


Works just for SDE tables


registrationId corresponds to table name in the Tables, _table_registry

nodename = who is locking the table


To see information in _table_registry, right click, select all row

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article