The previous developer of the website I was working on used this option in several of his queries and put a note (for speed).
>>It came back today. I got it three times. I really do not know how to adjust that to avoid this deadlock problem:
>
>I'm not sure what's causing the lock, but you can add the NOLOCK hint to your query. That will use the minimal amount of locking. The data might slightly be out of date, but it's still valid.
>
>
>DECLARE @NoMember Integer
>DECLARE @LastAccess DateTime
>
>SET @NoMember=12985
>SET @LastAccess='2009-02-13 11:02:33'
>
>SELECT Member.Numero,Member.Nom,Member.Prenom,Member.LastAccess
> FROM Member WITH (NOLOCK)
> WHERE Member.LastAccess>=@LastAccess AND
> EXISTS (SELECT 1 FROM Monitor WHERE Monitor.NoMember2=Member.Numero AND Monitor.NoMember=@NoMember)
> ORDER BY 2
>
>
If it's not broken, fix it until it is.
My Blog