Posted by angsql on 11/24/05 13:21
This code works
set nocount on
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 )
if @@rowcount <= 500
begin
break
end
End
select * from loop_projectid
..AS
[Back to original message]
|