Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimizing a query
Message
De
12/09/2008 09:37:46
 
 
À
12/09/2008 06:19:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 6.5 and older
Divers
Thread ID:
01345942
Message ID:
01347037
Vues:
17
>Putting timing aside, does this query really give you what you want? To me it looks like Invoice join has no role other than checking if the client has an invoice with that amount (if a particular client has 2 or more matches?). Maybe a query like this would be more appropriate:
>
>
>-- If it is OK that you are not interested 
>-- in records that are modified after you passed them
>set transaction isolation level read uncommitted
>
>SELECT Numero 
>FROM Client
>WHERE 
>  NoEntity=@NoEntity AND 
>  Fic_Date < @Fic_Date AND 
>  Loss_Code=@Loss_Code AND 
>  CType=@CType AND
>  Numero in
>  (SELECT NoClient FROM Invoice WHERE Invoice.Amount=@Amount)
>
Thanks, I tried to create an example as close as the one we have. But, this approach is also something I tried. So, once we test it, I will be able to see if that helps. This is something that never caused a problem in VFP but only in SQL Server.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform