Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete row from cursor....only!
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Delete row from cursor....only!
Miscellaneous
Thread ID:
01048956
Message ID:
01048956
Views:
69
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
Next
Reply
Map
View

Click here to load this message in the networking platform