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
begin
fetch next from T_cursor into @PhoneNo
end
close T_cursor
deallocate T_cursor
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
begin
fetch next from T_cursor into @PhoneNo
end
close T_cursor
deallocate T_cursor