Posted by angsql on 11/24/05 11:23
Hi Erland,
I tried this code on my test box for deleting the data, I had a very
strange problem
here is my code
set nocount off
delete from loop_projectid
while 1=1
Begin
insert into loop_projectid
select top 500 project_id, project_name from pds_project P
where not exists ( select * from loop_projectid L where
P.Project_id=L.Project_id )
--print @@rowcount
if @@rowcount < 500
begin
break
End
end
select * from loop_projectid
********************************************************
I get 1244 rows when i do a select, BUT if I put a print @@rowcount in
front of IF, I get 500 rows. Could you please help me.
..AS
[Back to original message]
|