Re: Querry giving incorrect result

anonymous_at_discussions.microsoft.com
Date: 04/19/04


Date: Mon, 19 Apr 2004 15:08:00 -0700

That is the exact code i use in the querry script
with While 2>1 XXXX GO wrap around it to loop
The loop itself was a pointless infinite loop
Cos i have been gettin some odd entry
from my other querries so i wrote this script to
see if everything's workin the way it should be
and it ends up in these very random entry
in the baddata table where the ID in the
baddata table should not exist (<100001)..
So i am questioning if i am facing some hardware
issue or is it some software bug hole that
is bound to happen if i compare the ID with its
F Key counterpart in an infinate loop.
the actual ID in talbe A-B has around 5000+ entry
and it does put the system into kinda heavy work load
when i run it into an infinite loop

>-----Original Message-----
>why use a loop?
>
>e.g.
>
>insert into BADDATA (ID)
>select ID
> from TableA
> where not exists
> (
> select *
> from TableB
> where ID=TableA.ID
> )
>
>or
>
>insert into BADDATA (ID)
>select ID
> from TableA
> where ID not in (select ID from TableB)
>
>"Simon" <simon@bsctech.com> wrote in message
>news:13f801c42656$3837cb00$a001280a@phx.gbl...
>> Big problem here that is getting me frustrated
>> i have TABLE A and TABEL B
>>
>> TABLE A TABLE B
>> ID DATA ID (FK to TABLE A) DATA
>> 100001 = 100001
>> | |
>> 101000 101000
>>
>> So basically Table B's ID is identical with Table A
since
>> it is simply a FK to A's ID
>> when i do a querry in an infinate loop
>> IF TABLE A's ID
>> is not in TABLE B's ID
>> Then insert an entry in BADDATA table.
>>
>> Supposinly since talbe A and B's id is the same thing,
i
>> should not be able to catch anything in the BADDATA
>> table..
>>
>> HOWEVER what i end up with is after i loop the querry
for
>> like an hour or 2 , i will start seeing some entry in
the
>> BADDATA Table where the ID listed is less then
>> 100001 which this ID does NOT exist since the ID
started
>> FROM 100001.
>>
>> please if anyone can give me some idea here about what
>> went wrong i would be VERY gratefull
>>
>>
>>
>>
>
>
>.
>



Relevant Pages

  • Re: Querry giving incorrect result
    ... insert into BADDATA ... from TableA ... > when i do a querry in an infinate loop ...
    (microsoft.public.sqlserver.programming)
  • Re: How to Delete Rows in Excel In a Do Loop
    ... have to delete there are some that have a entry in each and every cell ... Richard Buttrey wrote: ... time you go through the loop. ... Now copy this formula down column A for the whole database ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Removing entry from @rray
    ... entry from an @rray. ... and places each line into the array. ... Redefining the @array element inside to loop ... I would also like to ask about terminating a loop ... ...
    (comp.lang.perl.misc)
  • Re: [bug] ata subsystem related crash with latest -git
    ... then it will dereference that invalid entry to see if it's a chain entry! ... The alternative is to rewrite the loop, but it's going to be ugly as hell, ... almost always end up pointing to one past the last entry after the loop. ...
    (Linux-Kernel)
  • Re: Need a Sanity Check
    ... I believe the calls to Text_IO may be potentially blocking. ... > task type Three_Entries_Type is ... > entry Start; ... > end loop; ...
    (comp.lang.ada)