HI Team need help in understanding the below code. I'm new to the programming.
I've 100 records in table abc.
declare @counter int
set @counter=1
while @counter>0
begin
begin
select * into #a from abc;
end;
begin
update x set y=m
from a x inner join b y
on x.id=i.id;
end;
begin
drop table #a
end;
select @counter=@@rowcount
end
My understanding it the loop will never encounter 0. so it become an infinite loop.
please help me in understand what the "select @counter=@@rowcount" will do and the loop will exit.
Sorry james there is small correction in code.