Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MSDE/SQL Server/etc - Stored procedures and such
Message
De
16/08/2003 12:54:22
 
 
À
16/08/2003 12:47:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00820729
Message ID:
00820789
Vues:
22
Thanks BOb (and all others too) for these lessons.

So if I've got a basic grasp of the situation it looks like Stored Procedures should be "welcomed" by most SQL Administrators, but I have other alternatives that should all be workable (minor re-writes required) though less efficient.

cheers

>>I understand that SQL Server allows that, but what I'm missing (I think) is... from one SELECT to the next, how does SQL Server know to keep the prior results around for later use IF I have sent the SELECTs each independently to it (as looks like would be the case with my present code)?
>>
>
>
>Because a dervied table is just part of the query... For example, lets say you have:
>
>VFP:
>
>SELECT sum(sales), salesman_id
>FROM sales
>GROUP BY salesman_id
>IN CURSOR salesamount
>
>SELECT *
>FROM salesmen s
>JOIN salesamount a ON s.salesman_id = a.salesman_id
>ORDER by s.lastname
>
>********************
>In sql server, you can use the first select as a derived table in the second select. So, the single select statement would be:
>
>SELECT *
>FROM salesmen s
>JOIN (
> SELECT sum(sales), salesman_id
> FROM sales
> GROUP BY salesman_id
> ) a ON s.salesman_id = a.salesman_id
>
>
>**********
>BOb
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform