Re: SQL query produces deferent results randomly!!!
From: raj (raj_at_discussions.microsoft.com)
Date: 10/07/04
- Next message: Kalen Delaney: "Re: How many pre-decimal positions/integer digits has a DECimal (5,3) defined field ?"
- Previous message: Zach Wells: "Re: Identity field question"
- In reply to: Steve Kass: "Re: SQL query produces deferent results randomly!!!"
- Next in thread: Steve Kass: "Re: SQL query produces deferent results randomly!!!"
- Reply: Steve Kass: "Re: SQL query produces deferent results randomly!!!"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 7 Oct 2004 14:09:07 -0700
Hi Steve
I haven't had a an ORDER BY in the curser before. All this issues turned up
before having the ORDER BY statement. I'll try to explain (in brief) the
situation. Unfortunately I'm not in in a position to post any codding as a
company policy.
* I gotta temp: table(A) with a single column -A query populate userNames in
this table (This works perfectly)
* I got another temp: table(B) with 5 columns - A curser runs on table A and
obtain userNames and passes as a parameter to a query which populates table
B(this works perfectly)
*I gotta aonther curser which runs again on the table(A), obtain userNames
and passes as a parameter to a CROSS TAB query, which places all the agents
in the table A in horizontical order.(Pls refer to the table demostration of
my original question)
---97% of time the result is correct. But 3% of time get wrong(Happens
Randomly, specially in Mondays:) THe data in the table belongs to col
headings/userNames are not in the correct place when it gets wrong..(Pls
refer to the table demostration of my original question)
Now I had a ORDER BY and realeased this again. Havan't had a issue since
last Tuesday. I like to wait and see what will happen on comming Monday.
But it is hard to tell this situation occurs, bcos I do not have a ORDER BY.
According to the query, it should work without having the ORDER BY. Could u
or anyone please explain me, how this might work, or what are the
circumstances, this may work if I have an ORDER by on my last Curser.
Rellay appreciate steve, david and others ideas on this.
Thanks
raj
"Steve Kass" wrote:
> Raj,
>
> My guess is that you've got no ORDER BY clause in the query defining
> the cursor. Can't say without more info, though.
>
> Steve Kass
> Drew University
>
> raj wrote:
>
> >I 'v gotta stored procedure runs in a production database which creates a
> >report. Within the stored procedure, I 've gotta curser which grabs user
> >names from a temperory table and pass into another SQL query which
> >dinamically building a cross tab query. I found rearly this query produces an
> >inconsistace results. (Specially on Mondays). The format of the query is
> >below(Correct report)
> >----------UserA | User B | User C | User D
> >Activity1 A1 B1 C1 D1
> >Activity2 A2 B2 C3 D2
> >Activity3 A3 B3 C3 D3
> >Activity4 A4 B4 C4 D4
> >------------------------------------------------------------------
> >(Randomly get inconsistance result)
> >
> >----------UserA | User B | User C | User D
> >Activity1 A1 C1 B1 D1
> >Activity2 A2 C2 B3 D2
> >Activity3 A3 C3 B3 D3
> >Activity4 A4 C4 B4 D4
> >------------------------------------------------------------------
> >
> >I would greatly appreciate with any ideas?
> >
> >Raj
> >
> >
> >
> >
>
- Next message: Kalen Delaney: "Re: How many pre-decimal positions/integer digits has a DECimal (5,3) defined field ?"
- Previous message: Zach Wells: "Re: Identity field question"
- In reply to: Steve Kass: "Re: SQL query produces deferent results randomly!!!"
- Next in thread: Steve Kass: "Re: SQL query produces deferent results randomly!!!"
- Reply: Steve Kass: "Re: SQL query produces deferent results randomly!!!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|