declare T_cursor cursor for select PhoneNo from PhoneDetail order by phoneno
open T_cursor
fetch next from T_cursor into @PhoneNo
while @@fetch_status=0
end
close T_cursor
deallocate T_cursor
open T_cursor
fetch next from T_cursor into @PhoneNo
while @@fetch_status=0
begin
end
close T_cursor
deallocate T_cursor