Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set relation to in SQL database
Message
 
À
11/12/2006 02:04:31
Yh Yau
Ingenuity Microsystems Sdn Bhd
Kuala Lumpur, Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01176444
Message ID:
01176460
Vues:
7
It is much, much quicker to create a stored procedure per report and put the joins in there. One thing you shouldn't ever do is make a stored procedure multi-use. For example, say you want a list of clients using different search criteria.

Don't do this

create procedure dbo.findclient @option nchar(1),@term nvarchar(30) AS

IF @option='A'
BEGIN
END
IF @option='B'
BEGIN
END

etc

The reason is that SQL will create an execution plan for the whole procedure based on the best combination of indexes available the first time the proc is called. So if you call findclient with 'A' and this does a table scan, then call it with 'B' which would benefit from an index key, then it won't get used...
The other thing you want to avoid is recompiles. These have an overhead on SQL which can be significant on an operational system.

It is far more efficient to do all of the JOINs on SQL Server than it is to download data into VFP and then try to do the SET RELATION TO method. The less data that get's transferred over the network the better.
SJC Systems Limited
WorldSpreads Limited (www.worldspreads.com)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform