i was wondering what would happen if you tried to access a table in MS SQL which had already been locked by another process. Would it generate an error or just hold the process off untill the table was unlocked?
Printable View
i was wondering what would happen if you tried to access a table in MS SQL which had already been locked by another process. Would it generate an error or just hold the process off untill the table was unlocked?
Depends upon the lock type, and what you're doing. If you're trying to edit what the other user's editing, an error is raised. You can handle that error.
I am locking the table pessimistically to insert rows. So I assumed that if another app tried to insert rows whilst the table is locked it would generate an error, I was just having problems proving it.