When I right-click on a table in SQL Server Management Studio and choose ‘Edit top 200 rows’, at what point, if ever, would the data that I’m looking at be locked?
A colleague of mine stated that when viewing data in this way, the data rows can be locked (I think when he said if you put a cursor on a row and start editing data).
Is this the only time the data can be locked in this context?
It’s not true. Run this script in one window (and leave it running):
Every 5 seconds, it flips the value of the
Val1column, and printsUpdatedin the messages tab (assuming you’re set to “results in grid”).Then, in another instance of SSMS, open the
Txtable and start editing the single row in there. Observe that the script continues to perform updates.