Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimizing a query
Message
From
12/09/2008 09:37:46
 
 
To
12/09/2008 06:19:08
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 6.5 and older
Miscellaneous
Thread ID:
01345942
Message ID:
01347037
Views:
15
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform