Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deadlock revisited
Message
De
13/02/2009 15:53:32
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Web
Divers
Thread ID:
01381607
Message ID:
01381648
Vues:
49
>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
The accuracy of the data has to be 100%. So, if NOLOCK could cause the data to not be accurate, I cannot use that approach.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform