select * into #t1 from Userinfo
declare @id varchar(2000);
while (exists(select ProjectID from #t1))
begin
select @id=userid from #t1
delete #t1 where ProjectID=@id
end
drop table #t1
select * into #t1 from Userinfo
declare @id varchar(2000);
while (exists(select ProjectID from #t1))
begin
select @id=userid from #t1
delete #t1 where ProjectID=@id
end
drop table #t1