>UPDATE Member SET LastAccess=@LastAccess WHERE Numero=@Numero
>
>
>This update on the Member table can only be done by one person. So, there cannot be two updates done on that record at the same time. Why do I end up with a deadlock on some isolated situations?
Michel, this is something where utilizing SQL Profiler might help (or some other event-based approach to monitor what statements are occurring), to see what actually is going on.
If only one update can happen, my guess is that there is some read process going on at the same time. And maybe that read process is taking a while to occur.
If I do this...
SELECT * FROM Member where Numero = @Numero
And for whatever reason, that query takes a good while to run, that places a read (shared) lock on the row. That prevents other processes from issuing a write lock on the same row.
You might want to check if there are any locked processes against the database. But either way.....for an UPDATE to occur,, SQL Server needs to be able to issue a write lock. And that is not possible if there are read locks on the row at the same time.