JustWondering
Technical User
Please take a look at this code and tell me what it does?
If there are 2 records with the same fieldx & fieldy, will they be remove both or just one?
Thanks.
-------
declare
@fieldx char(5),
@fieldy char(5)
declare the_cursor cursor for
select fieldx,fieldy
from Table1
open the_cursor
fetch from the_cursor into @fieldx,@fieldy
while @@FETCH_STATUS = 0 begin
delete tabel1 where fieldx=@fieldx and fieldy=@fieldy
fetch from the_cursor into @fieldx,@fieldy
end
close the_cursor
deallocate the_cursor
------------
If there are 2 records with the same fieldx & fieldy, will they be remove both or just one?
Thanks.
-------
declare
@fieldx char(5),
@fieldy char(5)
declare the_cursor cursor for
select fieldx,fieldy
from Table1
open the_cursor
fetch from the_cursor into @fieldx,@fieldy
while @@FETCH_STATUS = 0 begin
delete tabel1 where fieldx=@fieldx and fieldy=@fieldy
fetch from the_cursor into @fieldx,@fieldy
end
close the_cursor
deallocate the_cursor
------------