Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete row from cursor....only!
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01048956
Message ID:
01049058
Vues:
19
No, you cannot. Why would you want to in the first place?

>I want to delete a row from a cursor I'm using. I DO NOT want to delete this record from the table I got the data for the cursor from. All articles I have found say it deletes the row in the table as well. Is there anyway to just delete the cursor row?
>open a_item
>fetch next from a_item into @giveid,@item,@freqindays
>
>--run through the cursor	
>while @@fetch_status = 0
>begin
>
>--preform function
>if ((select max(invdte) from pkpro..artran where item = @item and custno = @custno) > dateadd(day,-@freqindays,getdate()))
>	begin
>		delete from a_item where current of a_item
>	end
>else
>	begin
>		select @giveid,@item
>	end
>
>--fetch the next record
>fetch next from a_item into @giveid,@item,@freqindays
>
>--end and close the cursor
>end
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform