Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scan of table
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01312331
Message ID:
01312882
Vues:
15
Sure, even WHILE EXISTS(...) should work, but I just wanted to use the variable itself as WHILE terminator.


>Or
>
>WHILE 1=1
>    BEGIN
>       PRINT @ClaimRef
>       SELECT @MasterRef = c.MasterRef,
>              @ClaimRef  = c.ClaimRef
>		FROM claim c
>			INNER JOIN (SELECT MIN(ClaimRef) AS ClaimRef FROM claim
>					WHERE ClaimRef > @ClaimRef) Tbl1
>			ON p.ClaimRef = Tbl1.ClaimRef
>	IF @@ROWCOUNT = 0
>		BREAK
>    END
>
>>Right,
>>not help at all.
>>Hmm
>>
>>Create Procedure DontUseCursors
>>As
>>DECLARE @MasterRef    varchar(10)
>>DECLARE @ClaimRefCurr varchar(10)
>>DECLARE @ClaimRef     varchar(10)
>>
>>SELECT @MasterRef    = c.MasterRef,
>>       @ClaimRef     = c.ClaimRef
>> FROM claim c
>>      INNER JOIN (SELECT MIN(ClaimRef) AS ClaimRef FROM Claim) Tbl1
>>ON c.ClaimRef = Tbl1.ClaimRef
>>
>>WHILE @ClaimRef IS NOT NULL
>>    BEGIN
>>       print @ClaimRef
>>       SET @ClaimRefCurr = @ClaimRef
>>       SET @ClaimRef     = NULL
>>       SELECT @MasterRef = c.MasterRef,
>>              @ClaimRef  = c.ClaimRef
>> 	FROM claim c
>>        INNER JOIN (SELECT MIN(ClaimRef) AS ClaimRef FROM claim
>>                           WHERE ClaimRef > @ClaimRefCurr) Tbl1
>>	ON p.ClaimRef = Tbl1.ClaimRef
>>    END
>>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform