From time to time the question comes up in newsgroups, informal conversations between developers, and surprise phone calls. The questions come in many flavors:
- What is the DEX_ROW_ID?
- Why do all Dynamics GP's SQL Server tables have a DEX_ROW_ID?
- How is the DEX_ROW_ID related to IDENTITY columns in SQL Server tables?
- Can I build reports using the DEX_ROW_ID column?
To start unreeling these questions it is best to start with two key concepts: active and passive record locks.Active Locks
An active lock allows other users to read a table record, but not make any changes or delete the record. Active locking ensures that the user who has the active lock is the only user who can make changes or delete the record. If other users try to delete or change the record, a table-sharing error will occur. An active lock is applied each time a record is read using the Dexterity change
or edit table
statements with the lock keyword included.Passive Locks
A passive lock allows other users to access the record. Other users can delete the record or make changes to it. Passive locking ensures that other users accessing the record can be made aware that the record has been deleted or that the contents of the record have changed. A passive lock is applied each time a record is read using the change
or edit table
statement.What is the DEX_ROW_ID?
As part of Dexterity's table definition requirements, active locking must be enabled on a per-table basis by marking the Allow Active…