Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Query
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00203888
Message ID:
00204316
Vues:
38
>SELECT id, first, middle, last, type, expdt, fromdt, thrudt, 9999.99 as dues, 999 as instal, 9999 as months from master where group = 'Member' and delet <> 1 and exprdt >= m.expdt1 and expdt <= expdt2 and id not in (select dueid from dues where period = ?m.period or (duetype = 'LIFE' and thrudt = '12/31/9999')) order by last

If you run the query in iSQL/W does it still seem to take as much time. I'm wondering if the problem is how SQL Server is solving the query or whether it's VFP writing the result to disk when it creates the cursor.

Bob made some good suggestions. Definitely make sure that the index statistics are up to date. You'll probably get better results if you place a clustered index on master.exprdt. But you might affect something somewhere else.

SQL Server 6.5 doesn't really handle "not equals" very well. Could you change:

delet <> 1

To:

(delet < 0 or delet > 1)

SQL Server has special routines to handle ORs so it might work.

Since the only thing you're changing is the date range, I don't think that the problem is in the subquery.

Good luck

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform