It's more theoretical question but I need to do something with it.
I have web interface and SQL Server 2012 behind it. Which is given me a lot of problem on UPDATE
I have one table let's call it Contract
which has 100+ columns.
When user from web interface is doing an UPDATE
it's exclusively locking whole table instead of only updated row, so the other users can't do inserts
or updates
some times selects
which sometimes is causing multiple deadlocks.
Usually update looks like
UPDATE Contract
set
param1=@1,
param2=@2,
param3=@3,
param4=@4,
.....
where id=@id
How to fix this lock or maybe how to tell to SQL Server lock only row on updates
?