Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get next n records from previous call
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Get next n records from previous call
Divers
Thread ID:
00691967
Message ID:
00691967
Vues:
75
Hi all,

Let me tell you first : I am to be treated as the total newby on SQL RDBMS, although some theoretical background exists.

The 1M$ question :

Focused on SQL2000 (but any other is allowed to be the subject), how would it be possible to tell the DB-Server that starting from a Key (PK, SK) the n number of records should be taken in the result, the next call retrieving the next bunch of n records.

Constraints

Supposed n = 500 I want to stop the server piling up the result, reaching the 500th result record. This is similar to SELECT TOP 500 (not even knowing whether the server will read 10,000 records if they ‘d match the Select).

With the given fact that the Select concerned will (would) find 10,000 records, and that I retrieved the first 500 only (and that it is possible to read the first 500 without the remainder) … what would be the command to retrieve the next 500 (etc. etc.) ?

I’d say that the server won’t know about the previous command, and that therefore it is impossible to achieve this. And to be clear on this : the assumption must be that there is no PK or (unique) SK to hook in to (so GetNext etc. can’t do the job).

Use case

A user, initially starting some query is to be given the opportunity to abort the query, but obviously has to see some of the results first. But, the user is allowed to quit anytime, so after record 1,000 he/she can still decide to quit.
I just try to achieve that the DB-server isn’t uncessesarily stressed. That’s all.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform