Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
For... Next for SQL
Message
De
16/07/2004 04:05:30
 
 
À
13/07/2004 19:26:23
Ricardo Giron
Secrex Compañía de Seguros de Crédito
Lima, Pérou
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00924012
Message ID:
00925060
Vues:
15
>Hi!
>
>How can I implement a For... Next in SQL?
>
>Thanks


DECLARE myCursor CURSOR FOR SELECT {your select statement}

OPEN myCursor

FETCH NEXT FROM myCursor INTO @myVar1, @myVar2,...
WHILE @@FETCH_STATUS = 0
BEGIN
{do something here}
FETCH NEXT FROM myCursor INTO @myVar1, @myVar2,...
END
CLOSE myCursor
DEALLOCATE myCursor
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform