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:55:59
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00820729
Message ID:
00820790
Vues:
24
Thanks Sergey. That makes it clear.

I'm now heading back to my "Inside SQL Server 7" book for a refresher on all this stuff.

cheers

>Hi Jim,
>
>Here's a sample in VFP and T_SQL that should help you.
* VFP
>SELECT ... FROM table1 WHERE ... INTO CURCOR temp1
>SELECT ... FROM temp1 WHERE ... INTO CURCOR crsResult
>*T-SQL
>SELECT ... FROM
>    ( SELECT ... FROM table1 WHERE ... ) temp1
> WHERE ...
>
As you can see in T-SQL first select is embedded onto the second one and became 'derived table'. Keep in mind the 'cursor' in T-SQL has totally different meanning than in VFP. T-SQL cursors are used to do processing recvord by record, not to store interrmidite data.
>
>>>Jim,
>>>
>>>PMFJI, Sql Server allows to use result set returned by one query (called derived table) as a source of another. You could redisign your sequence of 3-8 queries into one using derived tables and joins. Even using sproc's you should do that to make queries more effficient.
>>
>>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)?
>>
>>I believe that I can do this in a SP (reun them all as a single unit) but want to learn if it's possible without SPs.
>>
>>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform