Showing posts with label run. Show all posts
Showing posts with label run. Show all posts

Friday, March 30, 2012

One More Question On Running Parallel Queries

An Execute SQL task takes 1 min to run a statement "insert into Mytable select * from view_using_joins"

Output: 10,225 rows affected.

But a Dataflow task configured to fetch data from the same view_using_joins into MyTable takes hours to do the same.

Could you please explain why is it so ?

Thanks

Subhash Subramanyam

I am not surprised that the Execute SQL Task is quicker. When you're inserting from one table to another in the same database then SSIS isn't going to outperform the database engine.

I don't know why it is hours quicker. There isn't really enough information here to say. What destination adapter are you using? Is the package running on the same machine as the database? Are you doing transformations on the way?

-Jamie

|||

Hi Jamie,

Thanks for your reply.

1) I am running packages on a different server.

2) Using OLEDB adapters for Source and Destination . Here Database as well as the server are same for Source and Destination

3) No transformations in between

Wonder if we have to do some extra settings to here to achieve the same duration as that of execute sql task ?

Thanks

Subhash Subramanyam

|||

Have you chosen Fast Load on your destination?

Thanks.

|||

Subhash512525 wrote:

Hi Jamie,

Thanks for your reply.

1) I am running packages on a different server.

2) Using OLEDB adapters for Source and Destination . Here Database as well as the server are same for Source and Destination

3) No transformations in between

Wonder if we have to do some extra settings to here to achieve the same duration as that of execute sql task ?

Thanks

Subhash Subramanyam

You're running the package on a different server? I'd suggest that's yur problem right there. The data is going to have to go over the network - obviously this is going to take time.

Also, in your destination are you inserting with Fast Load?

I say again, in this scenario the data-flow isn't going to outperform the Execute SQL Task.

-Jamie

|||

Great Jamie, you figured out.

If you don't mind spending few minutes here, I am coming back to my actual scenario.

I surely expect specific views from experts here for each of the questions here: Phil B, Rafael S, Darren G, Jwelch, JayH, Scott B, Ashwin S, Brian, Bob, Donald F and many others I am still not aware of.

Scenario:

1) My SSIS Packages are run at US server. scheduleld during Nights.

2) Each Package runs 6-8 queries each having Joins Parallelly pulling data from Oracle Database Source (UNIX) in Europe, Total Data extracted do not exceed 5 Million rows)

3) Destination Database is at US.

4) Network Bandwidth (2 Mbps)

Problem is that It almost takes ages to execute these Packages (Ranging from 25 hours to 30 hours)

Questions are:

1) Where should I expect to run the SSIS Packages to give a better performance?

2) How can I perform only incremental load (using Dataflow task) taking into consideration performance aspects? (Any links for this can help)

3) Does the overlap of the Schedules for SSIS packages afffect the performance?

4) Are there any limits on running number of queries in parallell to pull data from oracle source

5) Will it be the best way, If I spool the query results into flat files on a local system where the source (oracle database) runs at Europe and then ftp them to a shared server at US, which I can use it for importing into Destination table

Waiting for your reply,

Many Thanks and Regards

Subhash Subramanyam

|||Thanks Bob, Please give your answers for my below questions if don't mind.|||The more work you can do to prevent keeping the data transmission "pipe" open, the better.

Perform your source query in Europe, export that to a file, compress it, and then FTP it to the US. Then uncompress it, and load it with SSIS.

The idea is to keep your transmissions across "the pond" as short as possible.|||

From your question #2, I'm assuming you are pulling all rows every night. As Phil mentioned, you want to minimize how much data you are actually moving, so I'd definately make this incremental. A common way to implement that is by checking modified dates on the source system via a WHERE clause in your source SELECT statements. Store the range of modified dates that you retreive, and when the package is run the next night, start from the end of the previous range.

If you don't have modified dates in the source system, consider adding them. Alternatives are using triggers to track changes, or using a change data capture tool - I believe Oracle has one, and SQL Server will have one with SQL Server 2008.

|||

One more question:

6) If I have 6-8 queries running in parallel, Whether having a common connection Manager (for an Oracle source) for all performs better or having Distinct Connection Manager performs better ?

Still expecting suggestions and the views of rest of the experts for six questions listed here.

Regards

Subhash Subramanyam

|||

Subhash512525 wrote:

6) If I have 6-8 queries running in parallel, Whether having a common connection Manager (for an Oracle source) for all performs better or having Distinct Connection Manager performs better ?

It depends Smile Using a single one should result in the same performance as having several, assuming you are not using RetainSameConnection on them. Having a single connection manager doesn't mean that SSIS won't open multiple connections to the database. A Connection Manager manages multiple connections to the database, unless you force it to use only a single connection with RetainSameConnection.

A related note - in your scenario, have you tested whether performance is better if you run all queries sequentially or in parallel (by using precedence constraints on the data flow tasks)?

|||

jwelch wrote:

A related note - in your scenario, have you tested whether performance is better if you run all queries sequentially or in parallel (by using precedence constraints on the data flow tasks)?

Jwelch, This seem more practical. I'll test this and let you know..

Thanks

Subhash

One last xp_cmdshell Q (sorry)

I run the below on the box that has psExec installed as sa (dbo) in QA.
The MSSQLSERVER service is set to Local Account.
Domain\Administrator will run c:\psexec \\10.2.27.230 -I cmdmgr_Resume.bat
from a CmdExec job sucessfully. I run same from command prompt successfully.
Do I have to set MSSQLSERVER agent to start as admin.?
Or can I explicitly say exec master.Domain\Administrator.cp_cmdshell or
similar?
Even our DBA is stumped!!
EXEC xp_cmdshell 'c:\psexec \\10.2.27.230 -I cmdmgr_Resume.bat' ;
output
---
NULL
PsExec v1.60 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com
NULL
Access is denied.
Connecting to 10.2.27.230...
Couldn't access 10.2.27.230:
NULL
It looks like psExec doesn't have permission but it is SQL QA that is the
sourcer of the problem.Local Account? or Local System? The SQL Server service must execute with
the credentials needed to execute commands on the other computer. It cannot
execute as Local System. It must execute as a domain user account.
WARNING!!! It is extremely dangerous to use xp_cmdshell in this way. It is
even more dangerous to run as a domain admin. If you're a consultant, be
sure you have a battalion of lawyers in your pocket and review your
professional insurance contract, because it would be a simple thing for a
smart lawyer to prove gross negligence on your part.
"marcmc" <marcmc@.discussions.microsoft.com> wrote in message
news:642C7D5B-DA48-427D-9535-0BF66E90ADA4@.microsoft.com...
> I run the below on the box that has psExec installed as sa (dbo) in QA.
> The MSSQLSERVER service is set to Local Account.
> Domain\Administrator will run c:\psexec \\10.2.27.230 -I cmdmgr_Resume.bat
> from a CmdExec job sucessfully. I run same from command prompt
successfully.
> Do I have to set MSSQLSERVER agent to start as admin.?
> Or can I explicitly say exec master.Domain\Administrator.cp_cmdshell or
> similar?
> Even our DBA is stumped!!
> EXEC xp_cmdshell 'c:\psexec \\10.2.27.230 -I cmdmgr_Resume.bat' ;
> output
> ---
> NULL
> PsExec v1.60 - Execute processes remotely
> Copyright (C) 2001-2005 Mark Russinovich
> Sysinternals - www.sysinternals.com
> NULL
> Access is denied.
> Connecting to 10.2.27.230...
>
> Couldn't access 10.2.27.230:
> NULL
> It looks like psExec doesn't have permission but it is SQL QA that is the
> sourcer of the problem.|||thx again, what are the alternatives, create an account and lock it down,
maybe? or
"Brian Selzer" wrote:

> Local Account? or Local System? The SQL Server service must execute with
> the credentials needed to execute commands on the other computer. It cann
ot
> execute as Local System. It must execute as a domain user account.
> WARNING!!! It is extremely dangerous to use xp_cmdshell in this way. It i
s
> even more dangerous to run as a domain admin. If you're a consultant, be
> sure you have a battalion of lawyers in your pocket and review your
> professional insurance contract, because it would be a simple thing for a
> smart lawyer to prove gross negligence on your part.
> "marcmc" <marcmc@.discussions.microsoft.com> wrote in message
> news:642C7D5B-DA48-427D-9535-0BF66E90ADA4@.microsoft.com...
> successfully.
>
>|||Create an external process to do whatever it is you need to do. Then you
don't have to worry about the xp_cmdshell security hole. Another solution
is to use replication, but if you can't, then you can queue up the
information in a table and create a dequeue process to move it. Both of
these solutions is more robust, because you can still collect information if
the other system is down.
"marcmc" <marcmc@.discussions.microsoft.com> wrote in message
news:97BD8606-7F5A-4904-B13C-533FE167A77D@.microsoft.com...
> thx again, what are the alternatives, create an account and lock it down,
> maybe? or
> "Brian Selzer" wrote:
>
with
cannot
is
be
a
QA.
cmdmgr_Resume.bat
or
the|||On Wed, 7 Sep 2005 05:46:10 -0700, marcmc wrote:

>I run the below on the box that has psExec installed as sa (dbo) in QA.
>The MSSQLSERVER service is set to Local Account.
>Domain\Administrator will run c:\psexec \\10.2.27.230 -I cmdmgr_Resume.bat
>from a CmdExec job sucessfully. I run same from command prompt successfully
.
>Do I have to set MSSQLSERVER agent to start as admin.?
>Or can I explicitly say exec master.Domain\Administrator.cp_cmdshell or
>similar?
>Even our DBA is stumped!!
Hi marcmc,
(S)he should check out what BOL says about services accounts.
If you really want to do it like this, than the least unsafe way is to:
a) Have your network administrator set up a domain account for use by
the SQL Server service. Make sure to change the password policy to not
automatically age the password.
b) Give this account all privileges required for SQL Server operation,
plus all privileges required to run your batch file. Don't give any
other privileges to this account. If your version of windows allows it,
disable the posibility to log on using this account as a normal user
(i.e. make it an account that can only be used by services)
c) Change the startup parameters for your SQL Server instance to log in
using this account instead of logging in as Local System.
d) Keep your fingers crossed :-)
But I agree with Brian that there are other ways to do this, and that
they are probably better!
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

One hell of a problem (SQL2K)

So...we have a SQL server and we are using a query to build a basis for a
report. We just recently noticed that depending on which machine you run the
query from you get a different answer.
Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
She gets like 6 returns and I get 189. What would casuse this? Where
should I start looking?
Here's the query:
SELECT P.CREATEDDT, P.CREATEDBY,
'MEASURE' OBJECT_TYPE,
P.PROJECTID OBJECTID,
P.PROJECTID,
P.TITLE,
' ' OTHER,
'Missing Make Model or Serial' ERROR,
P.PMC,
TS.STATUS,
TS.TRANSACTIONID,
''OTHER_PROJ,''OTHER_TITLE
FROM(SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
ATT INNER JOIN ACTIONSUMMARY ACSON
ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMION
ACS.MEASUREID = LMI.MEASUREIDLEFT JOIN VIEW_TRANSACTION_SUM TS ON
LMI.INCENTIVEID = TS.INCENTIVEID
WHERE P.PROJECTID IN(
SELECT PROJECTID FROMACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACSON
ATT.MEASUREID = ACS.MEASUREID
WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG1 6',
'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142 ',
'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISH E',
'FHEDISHG')
AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
<>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
AND IMPORTEDDT IS NULL
UNION
SELECT*,
(SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID
WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
(SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID
INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
FROM
(SELECT P.CREATEDDT,P.CREATEDBY,
'MEASURE' TYPE,
ATT.MEASUREID,
P.PROJECTID,
P.TITLE,
ATTRVALUE OTHER,
'Duplicate Serial Numbers' ERROR,
P.PMC,
TS.STATUS,
TS.TRANSACTIONID
FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
ACTIONSUMMARY ACSON
ATT.MEASUREID = ACS.MEASUREIDINNER JOIN PROJECT P ON
ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
P.PROJECTID = TS.PROJECTID
WHERE ATTRVALUE IN
(SELECT ATTRVALUE FROM ACTIONATTR
WHERE ATTRNAME IN ('SERIAL')
AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
GROUP BY ATTRVALUE
HAVING COUNT(ATTRVALUE) >1)
AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
<>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
AND IMPORTEDDT IS NULL)K
If you both are executing this through Query Analyzer, I'd
start by making sure you have the same connection settings,
properties on both PCs. From the menu in Query Analyzer,
Tools -> Options.
-Sue
On Mon, 2 Oct 2006 16:41:01 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:

>So...we have a SQL server and we are using a query to build a basis for a
>report. We just recently noticed that depending on which machine you run the
>query from you get a different answer.
>Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
>Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
>She gets like 6 returns and I get 189. What would casuse this? Where
>should I start looking?
>Here's the query:
>
>SELECT P.CREATEDDT, P.CREATEDBY,
>'MEASURE' OBJECT_TYPE,
>P.PROJECTID OBJECTID,
>P.PROJECTID,
>P.TITLE,
>' ' OTHER,
>'Missing Make Model or Serial' ERROR,
>P.PMC,
>TS.STATUS,
>TS.TRANSACTIONID,
>''OTHER_PROJ,''OTHER_TITLE
>FROM(SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
>ATT INNER JOIN ACTIONSUMMARY ACSON
>ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
>ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMION
>ACS.MEASUREID = LMI.MEASUREIDLEFT JOIN VIEW_TRANSACTION_SUM TS ON
>LMI.INCENTIVEID = TS.INCENTIVEID
>WHERE P.PROJECTID IN(
>SELECT PROJECTID FROMACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACSON
>ATT.MEASUREID = ACS.MEASUREID
>WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG1 6',
>'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142 ',
>'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISH E',
>'FHEDISHG')
>AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
>AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>AND IMPORTEDDT IS NULL
>
>UNION
>SELECT*,
>(SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>ATT.MEASUREID = ACS.MEASUREID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
>(SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>ATT.MEASUREID = ACS.MEASUREID
>INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
>FROM
>(SELECT P.CREATEDDT,P.CREATEDBY,
>'MEASURE' TYPE,
>ATT.MEASUREID,
>P.PROJECTID,
>P.TITLE,
>ATTRVALUE OTHER,
>'Duplicate Serial Numbers' ERROR,
>P.PMC,
>TS.STATUS,
>TS.TRANSACTIONID
>FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
>ACTIONSUMMARY ACSON
>ATT.MEASUREID = ACS.MEASUREIDINNER JOIN PROJECT P ON
>ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
>P.PROJECTID = TS.PROJECTID
>WHERE ATTRVALUE IN
>(SELECT ATTRVALUE FROM ACTIONATTR
>WHERE ATTRNAME IN ('SERIAL')
>AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
>GROUP BY ATTRVALUE
>HAVING COUNT(ATTRVALUE) >1)
>AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>AND IMPORTEDDT IS NULL)K
>
|||Sue - good thoughts. This is happening all across out network. Some
machines get 35 results and some get 189. We noticed because we switched
from Crystal X to Crystal XI (they are on different servers).
The connection settings in query analyzer are the same. All default.
Good thought, I didn't think to check there.
This also happens when querying through ODBC connections. And query
analyzer. I don't even know where to begin.
Any more ideas?
And thanks so much for replying!
"Sue Hoegemeier" wrote:

> If you both are executing this through Query Analyzer, I'd
> start by making sure you have the same connection settings,
> properties on both PCs. From the menu in Query Analyzer,
> Tools -> Options.
> -Sue
> On Mon, 2 Oct 2006 16:41:01 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
>
>
|||Are you using the same login? Perhaps the same tables aren't hit, because same tables exists with
different object owners?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Karl" <Karl@.discussions.microsoft.com> wrote in message
news:467A9CF7-0739-43D9-98E8-EC62BE9A8806@.microsoft.com...
> So...we have a SQL server and we are using a query to build a basis for a
> report. We just recently noticed that depending on which machine you run the
> query from you get a different answer.
> Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> She gets like 6 returns and I get 189. What would casuse this? Where
> should I start looking?
> Here's the query:
>
> SELECT P.CREATEDDT, P.CREATEDBY,
> 'MEASURE' OBJECT_TYPE,
> P.PROJECTID OBJECTID,
> P.PROJECTID,
> P.TITLE,
> ' ' OTHER,
> 'Missing Make Model or Serial' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID,
> ''OTHER_PROJ,''OTHER_TITLE
> FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
> ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> LMI.INCENTIVEID = TS.INCENTIVEID
> WHERE P.PROJECTID IN(
> SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG1 6',
> 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142 ',
> 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISH E',
> 'FHEDISHG')
> AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> AND IMPORTEDDT IS NULL
>
> UNION
> SELECT *,
> (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> FROM
> (SELECT P.CREATEDDT,P.CREATEDBY,
> 'MEASURE' TYPE,
> ATT.MEASUREID,
> P.PROJECTID,
> P.TITLE,
> ATTRVALUE OTHER,
> 'Duplicate Serial Numbers' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID
> FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> P.PROJECTID = TS.PROJECTID
> WHERE ATTRVALUE IN
> (SELECT ATTRVALUE FROM ACTIONATTR
> WHERE ATTRNAME IN ('SERIAL')
> AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> GROUP BY ATTRVALUE
> HAVING COUNT(ATTRVALUE) >1)
> AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> <>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> AND IMPORTEDDT IS NULL)K
>
|||I'm using the same login with both.
Any other thoughts?
"Tibor Karaszi" wrote:

> Are you using the same login? Perhaps the same tables aren't hit, because same tables exists with
> different object owners?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Karl" <Karl@.discussions.microsoft.com> wrote in message
> news:467A9CF7-0739-43D9-98E8-EC62BE9A8806@.microsoft.com...
>
|||Any differences when you look at the two in syscacheobjects?
I would guess you would find two different bucket ids to
identify them - you might get some clues with the values
there.
Any differences when you look at the execution plans on each
PC?
Other than that, have you tried just first executing each
select that are being unioned to narrow it down some? Or are
both results different on the two machines where you can
reproduce this issue.
-Sue
On Tue, 3 Oct 2006 09:00:01 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Sue - good thoughts. This is happening all across out network. Some
>machines get 35 results and some get 189. We noticed because we switched
>from Crystal X to Crystal XI (they are on different servers).
>The connection settings in query analyzer are the same. All default.
>Good thought, I didn't think to check there.
>This also happens when querying through ODBC connections. And query
>analyzer. I don't even know where to begin.
>Any more ideas?
>And thanks so much for replying!
>"Sue Hoegemeier" wrote:
|||How do I find my specific query in syschacheobjects? There's 20,000 items in
there or so.........
And what do you mean by differences in the execution plans on each PC? I
guess I don't get what your asking here.
Thanks so much for you help so far!!
(waiting for the other user to get back to run the selects seperately)
"Sue Hoegemeier" wrote:

> Any differences when you look at the two in syscacheobjects?
> I would guess you would find two different bucket ids to
> identify them - you might get some clues with the values
> there.
> Any differences when you look at the execution plans on each
> PC?
> Other than that, have you tried just first executing each
> select that are being unioned to narrow it down some? Or are
> both results different on the two machines where you can
> reproduce this issue.
> -Sue
> On Tue, 3 Oct 2006 09:00:01 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
>
>
|||1. Something like:
select *
from master..syscacheobjects
where sql like '<beginning of your sql statement> %'
2. Display the execution plan for the query on each PC. If
there is a difference, that might lead you to the issue.
In Query Analyzer, from the menu go to Query and select
Display Estimated Execution Plan.
-Sue
On Tue, 3 Oct 2006 12:40:02 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>How do I find my specific query in syschacheobjects? There's 20,000 items in
>there or so.........
>And what do you mean by differences in the execution plans on each PC? I
>guess I don't get what your asking here.
>Thanks so much for you help so far!!
>(waiting for the other user to get back to run the selects seperately)
>"Sue Hoegemeier" wrote:
|||1. -They both look good.........
2. The execution plan looks identical too.
Damn.......
"Sue Hoegemeier" wrote:

> 1. Something like:
> select *
> from master..syscacheobjects
> where sql like '<beginning of your sql statement> %'
> 2. Display the execution plan for the query on each PC. If
> there is a difference, that might lead you to the issue.
> In Query Analyzer, from the menu go to Query and select
> Display Estimated Execution Plan.
> -Sue
> On Tue, 3 Oct 2006 12:40:02 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
>
>
|||We are getting different results in the select statements - I broke it down
into two queries and we are getting different results there too. My
co-worker is getting 39, and then 23 while I am getting 276 and then 158.
Thats "alittle bit" of a difference.
"Sue Hoegemeier" wrote:

> 1. Something like:
> select *
> from master..syscacheobjects
> where sql like '<beginning of your sql statement> %'
> 2. Display the execution plan for the query on each PC. If
> there is a difference, that might lead you to the issue.
> In Query Analyzer, from the menu go to Query and select
> Display Estimated Execution Plan.
> -Sue
> On Tue, 3 Oct 2006 12:40:02 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
>
>

One hell of a problem (SQL2K)

So...we have a SQL server and we are using a query to build a basis for a
report. We just recently noticed that depending on which machine you run th
e
query from you get a different answer.
Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
She gets like 6 returns and I get 189. What would casuse this? Where
should I start looking?
Here's the query:
SELECT P.CREATEDDT, P.CREATEDBY,
'MEASURE' OBJECT_TYPE,
P.PROJECTID OBJECTID,
P.PROJECTID,
P.TITLE,
' ' OTHER,
'Missing Make Model or Serial' ERROR,
P.PMC,
TS.STATUS,
TS.TRANSACTIONID,
''OTHER_PROJ,''OTHER_TITLE
FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
LMI.INCENTIVEID = TS.INCENTIVEID
WHERE P.PROJECTID IN(
SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID
WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG14
2','ECWEG16',
'ECWEG18','ECWGE142','ECWGE16','ECWGE18'
,'ECWGG142',
'ECWGG16','ECWGG18','EHADISHE','EHADISHG
','FHEDISHE',
'FHEDISHG')
AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
<>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
AND IMPORTEDDT IS NULL
UNION
SELECT *,
(SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID
WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
(SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID
INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
FROM
(SELECT P.CREATEDDT,P.CREATEDBY,
'MEASURE' TYPE,
ATT.MEASUREID,
P.PROJECTID,
P.TITLE,
ATTRVALUE OTHER,
'Duplicate Serial Numbers' ERROR,
P.PMC,
TS.STATUS,
TS.TRANSACTIONID
FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
P.PROJECTID = TS.PROJECTID
WHERE ATTRVALUE IN
(SELECT ATTRVALUE FROM ACTIONATTR
WHERE ATTRNAME IN ('SERIAL')
AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
GROUP BY ATTRVALUE
HAVING COUNT(ATTRVALUE) >1)
AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
<>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
AND IMPORTEDDT IS NULL)KIf you both are executing this through Query Analyzer, I'd
start by making sure you have the same connection settings,
properties on both PCs. From the menu in Query Analyzer,
Tools -> Options.
-Sue
On Mon, 2 Oct 2006 16:41:01 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:

>So...we have a SQL server and we are using a query to build a basis for a
>report. We just recently noticed that depending on which machine you run t
he
>query from you get a different answer.
>Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
>Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
>She gets like 6 returns and I get 189. What would casuse this? Where
>should I start looking?
>Here's the query:
>
>SELECT P.CREATEDDT, P.CREATEDBY,
> 'MEASURE' OBJECT_TYPE,
> P.PROJECTID OBJECTID,
> P.PROJECTID,
> P.TITLE,
> ' ' OTHER,
> 'Missing Make Model or Serial' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID,
> ''OTHER_PROJ,''OTHER_TITLE
>FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL')
)
>ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> LMI.INCENTIVEID = TS.INCENTIVEID
>WHERE P.PROJECTID IN(
>SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
>WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG14
2','ECWEG16',
> 'ECWEG18','ECWGE142','ECWGE16','ECWG
E18','ECWGG142',
> 'ECWGG16','ECWGG18','EHADISHE','EHAD
ISHG','FHEDISHE',
> 'FHEDISHG')
>AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
>AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>AND IMPORTEDDT IS NULL
>
>UNION
>SELECT *,
> (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>ATT.MEASUREID = ACS.MEASUREID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>ATT.MEASUREID = ACS.MEASUREID
> INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
>FROM
>(SELECT P.CREATEDDT,P.CREATEDBY,
> 'MEASURE' TYPE,
> ATT.MEASUREID,
> P.PROJECTID,
> P.TITLE,
> ATTRVALUE OTHER,
> 'Duplicate Serial Numbers' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID
>FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOI
N
>ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> P.PROJECTID = TS.PROJECTID
>WHERE ATTRVALUE IN
>(SELECT ATTRVALUE FROM ACTIONATTR
>WHERE ATTRNAME IN ('SERIAL')
>AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
>GROUP BY ATTRVALUE
>HAVING COUNT(ATTRVALUE) >1)
>AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>AND IMPORTEDDT IS NULL)K
>|||Sue - good thoughts. This is happening all across out network. Some
machines get 35 results and some get 189. We noticed because we switched
from Crystal X to Crystal XI (they are on different servers).
The connection settings in query analyzer are the same. All default.
Good thought, I didn't think to check there.
This also happens when querying through ODBC connections. And query
analyzer. I don't even know where to begin.
Any more ideas?
And thanks so much for replying!
"Sue Hoegemeier" wrote:

> If you both are executing this through Query Analyzer, I'd
> start by making sure you have the same connection settings,
> properties on both PCs. From the menu in Query Analyzer,
> Tools -> Options.
> -Sue
> On Mon, 2 Oct 2006 16:41:01 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
>
>|||Are you using the same login? Perhaps the same tables aren't hit, because sa
me tables exists with
different object owners?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Karl" <Karl@.discussions.microsoft.com> wrote in message
news:467A9CF7-0739-43D9-98E8-EC62BE9A8806@.microsoft.com...
> So...we have a SQL server and we are using a query to build a basis for a
> report. We just recently noticed that depending on which machine you run
the
> query from you get a different answer.
> Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> She gets like 6 returns and I get 189. What would casuse this? Where
> should I start looking?
> Here's the query:
>
> SELECT P.CREATEDDT, P.CREATEDBY,
> 'MEASURE' OBJECT_TYPE,
> P.PROJECTID OBJECTID,
> P.PROJECTID,
> P.TITLE,
> ' ' OTHER,
> 'Missing Make Model or Serial' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID,
> ''OTHER_PROJ,''OTHER_TITLE
> FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL')
)
> ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> LMI.INCENTIVEID = TS.INCENTIVEID
> WHERE P.PROJECTID IN(
> SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG14
2','ECWEG16'
,
> 'ECWEG18','ECWGE142','ECWGE16','ECWGE18'
,'ECWGG142',
> 'ECWGG16','ECWGG18','EHADISHE','EHADISHG
','FHEDISHE',
> 'FHEDISHG')
> AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> AND IMPORTEDDT IS NULL
>
> UNION
> SELECT *,
> (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> FROM
> (SELECT P.CREATEDDT,P.CREATEDBY,
> 'MEASURE' TYPE,
> ATT.MEASUREID,
> P.PROJECTID,
> P.TITLE,
> ATTRVALUE OTHER,
> 'Duplicate Serial Numbers' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID
> FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> P.PROJECTID = TS.PROJECTID
> WHERE ATTRVALUE IN
> (SELECT ATTRVALUE FROM ACTIONATTR
> WHERE ATTRNAME IN ('SERIAL')
> AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> GROUP BY ATTRVALUE
> HAVING COUNT(ATTRVALUE) >1)
> AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> <>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> AND IMPORTEDDT IS NULL)K
>|||I'm using the same login with both.
Any other thoughts?
"Tibor Karaszi" wrote:

> Are you using the same login? Perhaps the same tables aren't hit, because
same tables exists with
> different object owners?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Karl" <Karl@.discussions.microsoft.com> wrote in message
> news:467A9CF7-0739-43D9-98E8-EC62BE9A8806@.microsoft.com...
>|||Any differences when you look at the two in syscacheobjects?
I would guess you would find two different bucket ids to
identify them - you might get some clues with the values
there.
Any differences when you look at the execution plans on each
PC?
Other than that, have you tried just first executing each
select that are being unioned to narrow it down some? Or are
both results different on the two machines where you can
reproduce this issue.
-Sue
On Tue, 3 Oct 2006 09:00:01 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Sue - good thoughts. This is happening all across out network. Some
>machines get 35 results and some get 189. We noticed because we switched
>from Crystal X to Crystal XI (they are on different servers).
>The connection settings in query analyzer are the same. All default.
>Good thought, I didn't think to check there.
>This also happens when querying through ODBC connections. And query
>analyzer. I don't even know where to begin.
>Any more ideas?
>And thanks so much for replying!
>"Sue Hoegemeier" wrote:
>|||How do I find my specific query in syschacheobjects? There's 20,000 items i
n
there or so.........
And what do you mean by differences in the execution plans on each PC? I
guess I don't get what your asking here.
Thanks so much for you help so far!!
(waiting for the other user to get back to run the selects seperately)
"Sue Hoegemeier" wrote:

> Any differences when you look at the two in syscacheobjects?
> I would guess you would find two different bucket ids to
> identify them - you might get some clues with the values
> there.
> Any differences when you look at the execution plans on each
> PC?
> Other than that, have you tried just first executing each
> select that are being unioned to narrow it down some? Or are
> both results different on the two machines where you can
> reproduce this issue.
> -Sue
> On Tue, 3 Oct 2006 09:00:01 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
>
>|||1. Something like:
select *
from master..syscacheobjects
where sql like '<beginning of your sql statement> %'
2. Display the execution plan for the query on each PC. If
there is a difference, that might lead you to the issue.
In Query Analyzer, from the menu go to Query and select
Display Estimated Execution Plan.
-Sue
On Tue, 3 Oct 2006 12:40:02 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>How do I find my specific query in syschacheobjects? There's 20,000 items
in
>there or so.........
>And what do you mean by differences in the execution plans on each PC? I
>guess I don't get what your asking here.
>Thanks so much for you help so far!!
>(waiting for the other user to get back to run the selects seperately)
>"Sue Hoegemeier" wrote:
>|||1. -They both look good.........
2. The execution plan looks identical too.
Damn.......
"Sue Hoegemeier" wrote:

> 1. Something like:
> select *
> from master..syscacheobjects
> where sql like '<beginning of your sql statement> %'
> 2. Display the execution plan for the query on each PC. If
> there is a difference, that might lead you to the issue.
> In Query Analyzer, from the menu go to Query and select
> Display Estimated Execution Plan.
> -Sue
> On Tue, 3 Oct 2006 12:40:02 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
>
>|||We are getting different results in the select statements - I broke it down
into two queries and we are getting different results there too. My
co-worker is getting 39, and then 23 while I am getting 276 and then 158.
Thats "alittle bit" of a difference.
"Sue Hoegemeier" wrote:

> 1. Something like:
> select *
> from master..syscacheobjects
> where sql like '<beginning of your sql statement> %'
> 2. Display the execution plan for the query on each PC. If
> there is a difference, that might lead you to the issue.
> In Query Analyzer, from the menu go to Query and select
> Display Estimated Execution Plan.
> -Sue
> On Tue, 3 Oct 2006 12:40:02 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
>
>

One hell of a problem (SQL2K)

So...we have a SQL server and we are using a query to build a basis for a
report. We just recently noticed that depending on which machine you run the
query from you get a different answer.
Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
She gets like 6 returns and I get 189. What would casuse this? Where
should I start looking?
Here's the query:
SELECT P.CREATEDDT, P.CREATEDBY,
'MEASURE' OBJECT_TYPE,
P.PROJECTID OBJECTID,
P.PROJECTID,
P.TITLE,
' ' OTHER,
'Missing Make Model or Serial' ERROR,
P.PMC,
TS.STATUS,
TS.TRANSACTIONID,
''OTHER_PROJ,''OTHER_TITLE
FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
LMI.INCENTIVEID = TS.INCENTIVEID
WHERE P.PROJECTID IN(
SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID
WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
'FHEDISHG')
AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
<>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
AND IMPORTEDDT IS NULL
UNION
SELECT *,
(SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID
WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
(SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID
INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
FROM
(SELECT P.CREATEDDT,P.CREATEDBY,
'MEASURE' TYPE,
ATT.MEASUREID,
P.PROJECTID,
P.TITLE,
ATTRVALUE OTHER,
'Duplicate Serial Numbers' ERROR,
P.PMC,
TS.STATUS,
TS.TRANSACTIONID
FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
ACTIONSUMMARY ACS ON
ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
P.PROJECTID = TS.PROJECTID
WHERE ATTRVALUE IN
(SELECT ATTRVALUE FROM ACTIONATTR
WHERE ATTRNAME IN ('SERIAL')
AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
GROUP BY ATTRVALUE
HAVING COUNT(ATTRVALUE) >1)
AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
<>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
AND IMPORTEDDT IS NULL)KIf you both are executing this through Query Analyzer, I'd
start by making sure you have the same connection settings,
properties on both PCs. From the menu in Query Analyzer,
Tools -> Options.
-Sue
On Mon, 2 Oct 2006 16:41:01 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:
>So...we have a SQL server and we are using a query to build a basis for a
>report. We just recently noticed that depending on which machine you run the
>query from you get a different answer.
>Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
>Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
>She gets like 6 returns and I get 189. What would casuse this? Where
>should I start looking?
>Here's the query:
>
>SELECT P.CREATEDDT, P.CREATEDBY,
> 'MEASURE' OBJECT_TYPE,
> P.PROJECTID OBJECTID,
> P.PROJECTID,
> P.TITLE,
> ' ' OTHER,
> 'Missing Make Model or Serial' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID,
> ''OTHER_PROJ,''OTHER_TITLE
>FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
>ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> LMI.INCENTIVEID = TS.INCENTIVEID
>WHERE P.PROJECTID IN(
>SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
>WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
> 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
> 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
> 'FHEDISHG')
>AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
>AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>AND IMPORTEDDT IS NULL
>
>UNION
>SELECT *,
> (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>ATT.MEASUREID = ACS.MEASUREID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>ATT.MEASUREID = ACS.MEASUREID
> INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
>FROM
>(SELECT P.CREATEDDT,P.CREATEDBY,
> 'MEASURE' TYPE,
> ATT.MEASUREID,
> P.PROJECTID,
> P.TITLE,
> ATTRVALUE OTHER,
> 'Duplicate Serial Numbers' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID
>FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
>ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> P.PROJECTID = TS.PROJECTID
>WHERE ATTRVALUE IN
>(SELECT ATTRVALUE FROM ACTIONATTR
>WHERE ATTRNAME IN ('SERIAL')
>AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
>GROUP BY ATTRVALUE
>HAVING COUNT(ATTRVALUE) >1)
>AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>AND IMPORTEDDT IS NULL)K
>|||Sue - good thoughts. This is happening all across out network. Some
machines get 35 results and some get 189. We noticed because we switched
from Crystal X to Crystal XI (they are on different servers).
The connection settings in query analyzer are the same. All default. :(
Good thought, I didn't think to check there.
This also happens when querying through ODBC connections. And query
analyzer. I don't even know where to begin. :(
Any more ideas?
And thanks so much for replying!
"Sue Hoegemeier" wrote:
> If you both are executing this through Query Analyzer, I'd
> start by making sure you have the same connection settings,
> properties on both PCs. From the menu in Query Analyzer,
> Tools -> Options.
> -Sue
> On Mon, 2 Oct 2006 16:41:01 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
> >So...we have a SQL server and we are using a query to build a basis for a
> >report. We just recently noticed that depending on which machine you run the
> >query from you get a different answer.
> >
> >Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> >Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> >
> >She gets like 6 returns and I get 189. What would casuse this? Where
> >should I start looking?
> >
> >Here's the query:
> >
> >
> >SELECT P.CREATEDDT, P.CREATEDBY,
> > 'MEASURE' OBJECT_TYPE,
> > P.PROJECTID OBJECTID,
> > P.PROJECTID,
> > P.TITLE,
> > ' ' OTHER,
> > 'Missing Make Model or Serial' ERROR,
> > P.PMC,
> > TS.STATUS,
> > TS.TRANSACTIONID,
> > ''OTHER_PROJ,''OTHER_TITLE
> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
> >ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> > ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> > ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> > LMI.INCENTIVEID = TS.INCENTIVEID
> >WHERE P.PROJECTID IN(
> >SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID
> >WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
> > 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
> > 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
> > 'FHEDISHG')
> >AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> >AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> > AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> ><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> >AND IMPORTEDDT IS NULL
> >
> >
> >
> >UNION
> >
> >SELECT *,
> >
> > (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >ATT.MEASUREID = ACS.MEASUREID
> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> > (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >ATT.MEASUREID = ACS.MEASUREID
> > INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> >FROM
> >(SELECT P.CREATEDDT,P.CREATEDBY,
> > 'MEASURE' TYPE,
> > ATT.MEASUREID,
> > P.PROJECTID,
> > P.TITLE,
> > ATTRVALUE OTHER,
> > 'Duplicate Serial Numbers' ERROR,
> > P.PMC,
> > TS.STATUS,
> > TS.TRANSACTIONID
> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> >ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> > ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> > P.PROJECTID = TS.PROJECTID
> >WHERE ATTRVALUE IN
> >(SELECT ATTRVALUE FROM ACTIONATTR
> >WHERE ATTRNAME IN ('SERIAL')
> >AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> >GROUP BY ATTRVALUE
> >HAVING COUNT(ATTRVALUE) >1)
> >AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> ><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> >AND IMPORTEDDT IS NULL)K
> >
>|||Are you using the same login? Perhaps the same tables aren't hit, because same tables exists with
different object owners?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Karl" <Karl@.discussions.microsoft.com> wrote in message
news:467A9CF7-0739-43D9-98E8-EC62BE9A8806@.microsoft.com...
> So...we have a SQL server and we are using a query to build a basis for a
> report. We just recently noticed that depending on which machine you run the
> query from you get a different answer.
> Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> She gets like 6 returns and I get 189. What would casuse this? Where
> should I start looking?
> Here's the query:
>
> SELECT P.CREATEDDT, P.CREATEDBY,
> 'MEASURE' OBJECT_TYPE,
> P.PROJECTID OBJECTID,
> P.PROJECTID,
> P.TITLE,
> ' ' OTHER,
> 'Missing Make Model or Serial' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID,
> ''OTHER_PROJ,''OTHER_TITLE
> FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
> ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> LMI.INCENTIVEID = TS.INCENTIVEID
> WHERE P.PROJECTID IN(
> SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
> 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
> 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
> 'FHEDISHG')
> AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> AND IMPORTEDDT IS NULL
>
> UNION
> SELECT *,
> (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> FROM
> (SELECT P.CREATEDDT,P.CREATEDBY,
> 'MEASURE' TYPE,
> ATT.MEASUREID,
> P.PROJECTID,
> P.TITLE,
> ATTRVALUE OTHER,
> 'Duplicate Serial Numbers' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID
> FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> P.PROJECTID = TS.PROJECTID
> WHERE ATTRVALUE IN
> (SELECT ATTRVALUE FROM ACTIONATTR
> WHERE ATTRNAME IN ('SERIAL')
> AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> GROUP BY ATTRVALUE
> HAVING COUNT(ATTRVALUE) >1)
> AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> <>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> AND IMPORTEDDT IS NULL)K
>|||I'm using the same login with both.
Any other thoughts?
"Tibor Karaszi" wrote:
> Are you using the same login? Perhaps the same tables aren't hit, because same tables exists with
> different object owners?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Karl" <Karl@.discussions.microsoft.com> wrote in message
> news:467A9CF7-0739-43D9-98E8-EC62BE9A8806@.microsoft.com...
> > So...we have a SQL server and we are using a query to build a basis for a
> > report. We just recently noticed that depending on which machine you run the
> > query from you get a different answer.
> >
> > Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> > Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> >
> > She gets like 6 returns and I get 189. What would casuse this? Where
> > should I start looking?
> >
> > Here's the query:
> >
> >
> > SELECT P.CREATEDDT, P.CREATEDBY,
> > 'MEASURE' OBJECT_TYPE,
> > P.PROJECTID OBJECTID,
> > P.PROJECTID,
> > P.TITLE,
> > ' ' OTHER,
> > 'Missing Make Model or Serial' ERROR,
> > P.PMC,
> > TS.STATUS,
> > TS.TRANSACTIONID,
> > ''OTHER_PROJ,''OTHER_TITLE
> > FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
> > ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> > ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> > ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> > LMI.INCENTIVEID = TS.INCENTIVEID
> > WHERE P.PROJECTID IN(
> > SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID
> > WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
> > 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
> > 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
> > 'FHEDISHG')
> > AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> > AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> > AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> > <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> > AND IMPORTEDDT IS NULL
> >
> >
> >
> > UNION
> >
> > SELECT *,
> >
> > (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID
> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> > (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID
> > INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> > FROM
> > (SELECT P.CREATEDDT,P.CREATEDBY,
> > 'MEASURE' TYPE,
> > ATT.MEASUREID,
> > P.PROJECTID,
> > P.TITLE,
> > ATTRVALUE OTHER,
> > 'Duplicate Serial Numbers' ERROR,
> > P.PMC,
> > TS.STATUS,
> > TS.TRANSACTIONID
> > FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> > ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> > ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> > P.PROJECTID = TS.PROJECTID
> > WHERE ATTRVALUE IN
> > (SELECT ATTRVALUE FROM ACTIONATTR
> > WHERE ATTRNAME IN ('SERIAL')
> > AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> > GROUP BY ATTRVALUE
> > HAVING COUNT(ATTRVALUE) >1)
> > AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> > <>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> > AND IMPORTEDDT IS NULL)K
> >
> >
>|||Any differences when you look at the two in syscacheobjects?
I would guess you would find two different bucket ids to
identify them - you might get some clues with the values
there.
Any differences when you look at the execution plans on each
PC?
Other than that, have you tried just first executing each
select that are being unioned to narrow it down some? Or are
both results different on the two machines where you can
reproduce this issue.
-Sue
On Tue, 3 Oct 2006 09:00:01 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:
>Sue - good thoughts. This is happening all across out network. Some
>machines get 35 results and some get 189. We noticed because we switched
>from Crystal X to Crystal XI (they are on different servers).
>The connection settings in query analyzer are the same. All default. :(
>Good thought, I didn't think to check there.
>This also happens when querying through ODBC connections. And query
>analyzer. I don't even know where to begin. :(
>Any more ideas?
>And thanks so much for replying!
>"Sue Hoegemeier" wrote:
>> If you both are executing this through Query Analyzer, I'd
>> start by making sure you have the same connection settings,
>> properties on both PCs. From the menu in Query Analyzer,
>> Tools -> Options.
>> -Sue
>> On Mon, 2 Oct 2006 16:41:01 -0700, Karl
>> <Karl@.discussions.microsoft.com> wrote:
>> >So...we have a SQL server and we are using a query to build a basis for a
>> >report. We just recently noticed that depending on which machine you run the
>> >query from you get a different answer.
>> >
>> >Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
>> >Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
>> >
>> >She gets like 6 returns and I get 189. What would casuse this? Where
>> >should I start looking?
>> >
>> >Here's the query:
>> >
>> >
>> >SELECT P.CREATEDDT, P.CREATEDBY,
>> > 'MEASURE' OBJECT_TYPE,
>> > P.PROJECTID OBJECTID,
>> > P.PROJECTID,
>> > P.TITLE,
>> > ' ' OTHER,
>> > 'Missing Make Model or Serial' ERROR,
>> > P.PMC,
>> > TS.STATUS,
>> > TS.TRANSACTIONID,
>> > ''OTHER_PROJ,''OTHER_TITLE
>> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
>> >ATT INNER JOIN ACTIONSUMMARY ACS ON
>> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
>> > ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
>> > ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
>> > LMI.INCENTIVEID = TS.INCENTIVEID
>> >WHERE P.PROJECTID IN(
>> >SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>> > ATT.MEASUREID = ACS.MEASUREID
>> >WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
>> > 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
>> > 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
>> > 'FHEDISHG')
>> >AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
>> >AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
>> > AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
>> ><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>> >AND IMPORTEDDT IS NULL
>> >
>> >
>> >
>> >UNION
>> >
>> >SELECT *,
>> >
>> > (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >ATT.MEASUREID = ACS.MEASUREID
>> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
>> > (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >ATT.MEASUREID = ACS.MEASUREID
>> > INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
>> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
>> >FROM
>> >(SELECT P.CREATEDDT,P.CREATEDBY,
>> > 'MEASURE' TYPE,
>> > ATT.MEASUREID,
>> > P.PROJECTID,
>> > P.TITLE,
>> > ATTRVALUE OTHER,
>> > 'Duplicate Serial Numbers' ERROR,
>> > P.PMC,
>> > TS.STATUS,
>> > TS.TRANSACTIONID
>> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
>> >ACTIONSUMMARY ACS ON
>> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
>> > ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
>> > P.PROJECTID = TS.PROJECTID
>> >WHERE ATTRVALUE IN
>> >(SELECT ATTRVALUE FROM ACTIONATTR
>> >WHERE ATTRNAME IN ('SERIAL')
>> >AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
>> >GROUP BY ATTRVALUE
>> >HAVING COUNT(ATTRVALUE) >1)
>> >AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
>> ><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>> >AND IMPORTEDDT IS NULL)K
>> >
>>|||How do I find my specific query in syschacheobjects? There's 20,000 items in
there or so.........
And what do you mean by differences in the execution plans on each PC? I
guess I don't get what your asking here.
Thanks so much for you help so far!!
(waiting for the other user to get back to run the selects seperately)
"Sue Hoegemeier" wrote:
> Any differences when you look at the two in syscacheobjects?
> I would guess you would find two different bucket ids to
> identify them - you might get some clues with the values
> there.
> Any differences when you look at the execution plans on each
> PC?
> Other than that, have you tried just first executing each
> select that are being unioned to narrow it down some? Or are
> both results different on the two machines where you can
> reproduce this issue.
> -Sue
> On Tue, 3 Oct 2006 09:00:01 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
> >Sue - good thoughts. This is happening all across out network. Some
> >machines get 35 results and some get 189. We noticed because we switched
> >from Crystal X to Crystal XI (they are on different servers).
> >
> >The connection settings in query analyzer are the same. All default. :(
> >Good thought, I didn't think to check there.
> >
> >This also happens when querying through ODBC connections. And query
> >analyzer. I don't even know where to begin. :(
> >
> >Any more ideas?
> >
> >And thanks so much for replying!
> >
> >"Sue Hoegemeier" wrote:
> >
> >> If you both are executing this through Query Analyzer, I'd
> >> start by making sure you have the same connection settings,
> >> properties on both PCs. From the menu in Query Analyzer,
> >> Tools -> Options.
> >>
> >> -Sue
> >>
> >> On Mon, 2 Oct 2006 16:41:01 -0700, Karl
> >> <Karl@.discussions.microsoft.com> wrote:
> >>
> >> >So...we have a SQL server and we are using a query to build a basis for a
> >> >report. We just recently noticed that depending on which machine you run the
> >> >query from you get a different answer.
> >> >
> >> >Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> >> >Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> >> >
> >> >She gets like 6 returns and I get 189. What would casuse this? Where
> >> >should I start looking?
> >> >
> >> >Here's the query:
> >> >
> >> >
> >> >SELECT P.CREATEDDT, P.CREATEDBY,
> >> > 'MEASURE' OBJECT_TYPE,
> >> > P.PROJECTID OBJECTID,
> >> > P.PROJECTID,
> >> > P.TITLE,
> >> > ' ' OTHER,
> >> > 'Missing Make Model or Serial' ERROR,
> >> > P.PMC,
> >> > TS.STATUS,
> >> > TS.TRANSACTIONID,
> >> > ''OTHER_PROJ,''OTHER_TITLE
> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
> >> >ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> >> > ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> >> > LMI.INCENTIVEID = TS.INCENTIVEID
> >> >WHERE P.PROJECTID IN(
> >> >SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> > ATT.MEASUREID = ACS.MEASUREID
> >> >WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
> >> > 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
> >> > 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
> >> > 'FHEDISHG')
> >> >AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> >> >AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> >> > AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> >> ><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> >> >AND IMPORTEDDT IS NULL
> >> >
> >> >
> >> >
> >> >UNION
> >> >
> >> >SELECT *,
> >> >
> >> > (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >ATT.MEASUREID = ACS.MEASUREID
> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> >> > (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >ATT.MEASUREID = ACS.MEASUREID
> >> > INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> >> >FROM
> >> >(SELECT P.CREATEDDT,P.CREATEDBY,
> >> > 'MEASURE' TYPE,
> >> > ATT.MEASUREID,
> >> > P.PROJECTID,
> >> > P.TITLE,
> >> > ATTRVALUE OTHER,
> >> > 'Duplicate Serial Numbers' ERROR,
> >> > P.PMC,
> >> > TS.STATUS,
> >> > TS.TRANSACTIONID
> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> >> >ACTIONSUMMARY ACS ON
> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> >> > P.PROJECTID = TS.PROJECTID
> >> >WHERE ATTRVALUE IN
> >> >(SELECT ATTRVALUE FROM ACTIONATTR
> >> >WHERE ATTRNAME IN ('SERIAL')
> >> >AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> >> >GROUP BY ATTRVALUE
> >> >HAVING COUNT(ATTRVALUE) >1)
> >> >AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> >> ><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> >> >AND IMPORTEDDT IS NULL)K
> >> >
> >>
> >>
>|||1. Something like:
select *
from master..syscacheobjects
where sql like '<beginning of your sql statement> %'
2. Display the execution plan for the query on each PC. If
there is a difference, that might lead you to the issue.
In Query Analyzer, from the menu go to Query and select
Display Estimated Execution Plan.
-Sue
On Tue, 3 Oct 2006 12:40:02 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:
>How do I find my specific query in syschacheobjects? There's 20,000 items in
>there or so.........
>And what do you mean by differences in the execution plans on each PC? I
>guess I don't get what your asking here.
>Thanks so much for you help so far!!
>(waiting for the other user to get back to run the selects seperately)
>"Sue Hoegemeier" wrote:
>> Any differences when you look at the two in syscacheobjects?
>> I would guess you would find two different bucket ids to
>> identify them - you might get some clues with the values
>> there.
>> Any differences when you look at the execution plans on each
>> PC?
>> Other than that, have you tried just first executing each
>> select that are being unioned to narrow it down some? Or are
>> both results different on the two machines where you can
>> reproduce this issue.
>> -Sue
>> On Tue, 3 Oct 2006 09:00:01 -0700, Karl
>> <Karl@.discussions.microsoft.com> wrote:
>> >Sue - good thoughts. This is happening all across out network. Some
>> >machines get 35 results and some get 189. We noticed because we switched
>> >from Crystal X to Crystal XI (they are on different servers).
>> >
>> >The connection settings in query analyzer are the same. All default. :(
>> >Good thought, I didn't think to check there.
>> >
>> >This also happens when querying through ODBC connections. And query
>> >analyzer. I don't even know where to begin. :(
>> >
>> >Any more ideas?
>> >
>> >And thanks so much for replying!
>> >
>> >"Sue Hoegemeier" wrote:
>> >
>> >> If you both are executing this through Query Analyzer, I'd
>> >> start by making sure you have the same connection settings,
>> >> properties on both PCs. From the menu in Query Analyzer,
>> >> Tools -> Options.
>> >>
>> >> -Sue
>> >>
>> >> On Mon, 2 Oct 2006 16:41:01 -0700, Karl
>> >> <Karl@.discussions.microsoft.com> wrote:
>> >>
>> >> >So...we have a SQL server and we are using a query to build a basis for a
>> >> >report. We just recently noticed that depending on which machine you run the
>> >> >query from you get a different answer.
>> >> >
>> >> >Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
>> >> >Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
>> >> >
>> >> >She gets like 6 returns and I get 189. What would casuse this? Where
>> >> >should I start looking?
>> >> >
>> >> >Here's the query:
>> >> >
>> >> >
>> >> >SELECT P.CREATEDDT, P.CREATEDBY,
>> >> > 'MEASURE' OBJECT_TYPE,
>> >> > P.PROJECTID OBJECTID,
>> >> > P.PROJECTID,
>> >> > P.TITLE,
>> >> > ' ' OTHER,
>> >> > 'Missing Make Model or Serial' ERROR,
>> >> > P.PMC,
>> >> > TS.STATUS,
>> >> > TS.TRANSACTIONID,
>> >> > ''OTHER_PROJ,''OTHER_TITLE
>> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
>> >> >ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
>> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
>> >> > ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
>> >> > LMI.INCENTIVEID = TS.INCENTIVEID
>> >> >WHERE P.PROJECTID IN(
>> >> >SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >> > ATT.MEASUREID = ACS.MEASUREID
>> >> >WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
>> >> > 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
>> >> > 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
>> >> > 'FHEDISHG')
>> >> >AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
>> >> >AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
>> >> > AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
>> >> ><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>> >> >AND IMPORTEDDT IS NULL
>> >> >
>> >> >
>> >> >
>> >> >UNION
>> >> >
>> >> >SELECT *,
>> >> >
>> >> > (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >> >ATT.MEASUREID = ACS.MEASUREID
>> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
>> >> > (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >> >ATT.MEASUREID = ACS.MEASUREID
>> >> > INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
>> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
>> >> >FROM
>> >> >(SELECT P.CREATEDDT,P.CREATEDBY,
>> >> > 'MEASURE' TYPE,
>> >> > ATT.MEASUREID,
>> >> > P.PROJECTID,
>> >> > P.TITLE,
>> >> > ATTRVALUE OTHER,
>> >> > 'Duplicate Serial Numbers' ERROR,
>> >> > P.PMC,
>> >> > TS.STATUS,
>> >> > TS.TRANSACTIONID
>> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
>> >> >ACTIONSUMMARY ACS ON
>> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
>> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
>> >> > P.PROJECTID = TS.PROJECTID
>> >> >WHERE ATTRVALUE IN
>> >> >(SELECT ATTRVALUE FROM ACTIONATTR
>> >> >WHERE ATTRNAME IN ('SERIAL')
>> >> >AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
>> >> >GROUP BY ATTRVALUE
>> >> >HAVING COUNT(ATTRVALUE) >1)
>> >> >AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
>> >> ><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>> >> >AND IMPORTEDDT IS NULL)K
>> >> >
>> >>
>> >>
>>|||1. -They both look good.........
2. The execution plan looks identical too.
Damn.......
"Sue Hoegemeier" wrote:
> 1. Something like:
> select *
> from master..syscacheobjects
> where sql like '<beginning of your sql statement> %'
> 2. Display the execution plan for the query on each PC. If
> there is a difference, that might lead you to the issue.
> In Query Analyzer, from the menu go to Query and select
> Display Estimated Execution Plan.
> -Sue
> On Tue, 3 Oct 2006 12:40:02 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
> >How do I find my specific query in syschacheobjects? There's 20,000 items in
> >there or so.........
> >
> >And what do you mean by differences in the execution plans on each PC? I
> >guess I don't get what your asking here.
> >
> >Thanks so much for you help so far!!
> >
> >(waiting for the other user to get back to run the selects seperately)
> >
> >"Sue Hoegemeier" wrote:
> >
> >> Any differences when you look at the two in syscacheobjects?
> >> I would guess you would find two different bucket ids to
> >> identify them - you might get some clues with the values
> >> there.
> >> Any differences when you look at the execution plans on each
> >> PC?
> >>
> >> Other than that, have you tried just first executing each
> >> select that are being unioned to narrow it down some? Or are
> >> both results different on the two machines where you can
> >> reproduce this issue.
> >>
> >> -Sue
> >>
> >> On Tue, 3 Oct 2006 09:00:01 -0700, Karl
> >> <Karl@.discussions.microsoft.com> wrote:
> >>
> >> >Sue - good thoughts. This is happening all across out network. Some
> >> >machines get 35 results and some get 189. We noticed because we switched
> >> >from Crystal X to Crystal XI (they are on different servers).
> >> >
> >> >The connection settings in query analyzer are the same. All default. :(
> >> >Good thought, I didn't think to check there.
> >> >
> >> >This also happens when querying through ODBC connections. And query
> >> >analyzer. I don't even know where to begin. :(
> >> >
> >> >Any more ideas?
> >> >
> >> >And thanks so much for replying!
> >> >
> >> >"Sue Hoegemeier" wrote:
> >> >
> >> >> If you both are executing this through Query Analyzer, I'd
> >> >> start by making sure you have the same connection settings,
> >> >> properties on both PCs. From the menu in Query Analyzer,
> >> >> Tools -> Options.
> >> >>
> >> >> -Sue
> >> >>
> >> >> On Mon, 2 Oct 2006 16:41:01 -0700, Karl
> >> >> <Karl@.discussions.microsoft.com> wrote:
> >> >>
> >> >> >So...we have a SQL server and we are using a query to build a basis for a
> >> >> >report. We just recently noticed that depending on which machine you run the
> >> >> >query from you get a different answer.
> >> >> >
> >> >> >Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> >> >> >Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> >> >> >
> >> >> >She gets like 6 returns and I get 189. What would casuse this? Where
> >> >> >should I start looking?
> >> >> >
> >> >> >Here's the query:
> >> >> >
> >> >> >
> >> >> >SELECT P.CREATEDDT, P.CREATEDBY,
> >> >> > 'MEASURE' OBJECT_TYPE,
> >> >> > P.PROJECTID OBJECTID,
> >> >> > P.PROJECTID,
> >> >> > P.TITLE,
> >> >> > ' ' OTHER,
> >> >> > 'Missing Make Model or Serial' ERROR,
> >> >> > P.PMC,
> >> >> > TS.STATUS,
> >> >> > TS.TRANSACTIONID,
> >> >> > ''OTHER_PROJ,''OTHER_TITLE
> >> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
> >> >> >ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> >> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> >> >> > ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> >> >> > LMI.INCENTIVEID = TS.INCENTIVEID
> >> >> >WHERE P.PROJECTID IN(
> >> >> >SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >> > ATT.MEASUREID = ACS.MEASUREID
> >> >> >WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
> >> >> > 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
> >> >> > 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
> >> >> > 'FHEDISHG')
> >> >> >AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> >> >> >AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> >> >> > AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> >> >> ><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> >> >> >AND IMPORTEDDT IS NULL
> >> >> >
> >> >> >
> >> >> >
> >> >> >UNION
> >> >> >
> >> >> >SELECT *,
> >> >> >
> >> >> > (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >> >ATT.MEASUREID = ACS.MEASUREID
> >> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> >> >> > (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >> >ATT.MEASUREID = ACS.MEASUREID
> >> >> > INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> >> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> >> >> >FROM
> >> >> >(SELECT P.CREATEDDT,P.CREATEDBY,
> >> >> > 'MEASURE' TYPE,
> >> >> > ATT.MEASUREID,
> >> >> > P.PROJECTID,
> >> >> > P.TITLE,
> >> >> > ATTRVALUE OTHER,
> >> >> > 'Duplicate Serial Numbers' ERROR,
> >> >> > P.PMC,
> >> >> > TS.STATUS,
> >> >> > TS.TRANSACTIONID
> >> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> >> >> >ACTIONSUMMARY ACS ON
> >> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> >> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> >> >> > P.PROJECTID = TS.PROJECTID
> >> >> >WHERE ATTRVALUE IN
> >> >> >(SELECT ATTRVALUE FROM ACTIONATTR
> >> >> >WHERE ATTRNAME IN ('SERIAL')
> >> >> >AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> >> >> >GROUP BY ATTRVALUE
> >> >> >HAVING COUNT(ATTRVALUE) >1)
> >> >> >AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> >> >> ><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> >> >> >AND IMPORTEDDT IS NULL)K
> >> >> >
> >> >>
> >> >>
> >>
> >>
>|||We are getting different results in the select statements - I broke it down
into two queries and we are getting different results there too. My
co-worker is getting 39, and then 23 while I am getting 276 and then 158.
Thats "alittle bit" of a difference. :(
"Sue Hoegemeier" wrote:
> 1. Something like:
> select *
> from master..syscacheobjects
> where sql like '<beginning of your sql statement> %'
> 2. Display the execution plan for the query on each PC. If
> there is a difference, that might lead you to the issue.
> In Query Analyzer, from the menu go to Query and select
> Display Estimated Execution Plan.
> -Sue
> On Tue, 3 Oct 2006 12:40:02 -0700, Karl
> <Karl@.discussions.microsoft.com> wrote:
> >How do I find my specific query in syschacheobjects? There's 20,000 items in
> >there or so.........
> >
> >And what do you mean by differences in the execution plans on each PC? I
> >guess I don't get what your asking here.
> >
> >Thanks so much for you help so far!!
> >
> >(waiting for the other user to get back to run the selects seperately)
> >
> >"Sue Hoegemeier" wrote:
> >
> >> Any differences when you look at the two in syscacheobjects?
> >> I would guess you would find two different bucket ids to
> >> identify them - you might get some clues with the values
> >> there.
> >> Any differences when you look at the execution plans on each
> >> PC?
> >>
> >> Other than that, have you tried just first executing each
> >> select that are being unioned to narrow it down some? Or are
> >> both results different on the two machines where you can
> >> reproduce this issue.
> >>
> >> -Sue
> >>
> >> On Tue, 3 Oct 2006 09:00:01 -0700, Karl
> >> <Karl@.discussions.microsoft.com> wrote:
> >>
> >> >Sue - good thoughts. This is happening all across out network. Some
> >> >machines get 35 results and some get 189. We noticed because we switched
> >> >from Crystal X to Crystal XI (they are on different servers).
> >> >
> >> >The connection settings in query analyzer are the same. All default. :(
> >> >Good thought, I didn't think to check there.
> >> >
> >> >This also happens when querying through ODBC connections. And query
> >> >analyzer. I don't even know where to begin. :(
> >> >
> >> >Any more ideas?
> >> >
> >> >And thanks so much for replying!
> >> >
> >> >"Sue Hoegemeier" wrote:
> >> >
> >> >> If you both are executing this through Query Analyzer, I'd
> >> >> start by making sure you have the same connection settings,
> >> >> properties on both PCs. From the menu in Query Analyzer,
> >> >> Tools -> Options.
> >> >>
> >> >> -Sue
> >> >>
> >> >> On Mon, 2 Oct 2006 16:41:01 -0700, Karl
> >> >> <Karl@.discussions.microsoft.com> wrote:
> >> >>
> >> >> >So...we have a SQL server and we are using a query to build a basis for a
> >> >> >report. We just recently noticed that depending on which machine you run the
> >> >> >query from you get a different answer.
> >> >> >
> >> >> >Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> >> >> >Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> >> >> >
> >> >> >She gets like 6 returns and I get 189. What would casuse this? Where
> >> >> >should I start looking?
> >> >> >
> >> >> >Here's the query:
> >> >> >
> >> >> >
> >> >> >SELECT P.CREATEDDT, P.CREATEDBY,
> >> >> > 'MEASURE' OBJECT_TYPE,
> >> >> > P.PROJECTID OBJECTID,
> >> >> > P.PROJECTID,
> >> >> > P.TITLE,
> >> >> > ' ' OTHER,
> >> >> > 'Missing Make Model or Serial' ERROR,
> >> >> > P.PMC,
> >> >> > TS.STATUS,
> >> >> > TS.TRANSACTIONID,
> >> >> > ''OTHER_PROJ,''OTHER_TITLE
> >> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
> >> >> >ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> >> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> >> >> > ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> >> >> > LMI.INCENTIVEID = TS.INCENTIVEID
> >> >> >WHERE P.PROJECTID IN(
> >> >> >SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >> > ATT.MEASUREID = ACS.MEASUREID
> >> >> >WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
> >> >> > 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
> >> >> > 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
> >> >> > 'FHEDISHG')
> >> >> >AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> >> >> >AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> >> >> > AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> >> >> ><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> >> >> >AND IMPORTEDDT IS NULL
> >> >> >
> >> >> >
> >> >> >
> >> >> >UNION
> >> >> >
> >> >> >SELECT *,
> >> >> >
> >> >> > (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >> >ATT.MEASUREID = ACS.MEASUREID
> >> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> >> >> > (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> >> >> >ATT.MEASUREID = ACS.MEASUREID
> >> >> > INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> >> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> >> >> >FROM
> >> >> >(SELECT P.CREATEDDT,P.CREATEDBY,
> >> >> > 'MEASURE' TYPE,
> >> >> > ATT.MEASUREID,
> >> >> > P.PROJECTID,
> >> >> > P.TITLE,
> >> >> > ATTRVALUE OTHER,
> >> >> > 'Duplicate Serial Numbers' ERROR,
> >> >> > P.PMC,
> >> >> > TS.STATUS,
> >> >> > TS.TRANSACTIONID
> >> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> >> >> >ACTIONSUMMARY ACS ON
> >> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> >> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> >> >> > P.PROJECTID = TS.PROJECTID
> >> >> >WHERE ATTRVALUE IN
> >> >> >(SELECT ATTRVALUE FROM ACTIONATTR
> >> >> >WHERE ATTRNAME IN ('SERIAL')
> >> >> >AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> >> >> >GROUP BY ATTRVALUE
> >> >> >HAVING COUNT(ATTRVALUE) >1)
> >> >> >AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> >> >> ><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> >> >> >AND IMPORTEDDT IS NULL)K
> >> >> >
> >> >>
> >> >>
> >>
> >>
>|||Your probably going to have to walk through one of those to
determine where the issue is and then go from there. Once
you narrow it down to a particular table, join or where
condition, it will probably be easier to solve.
-Sue
On Tue, 3 Oct 2006 15:00:02 -0700, Karl
<Karl@.discussions.microsoft.com> wrote:
>We are getting different results in the select statements - I broke it down
>into two queries and we are getting different results there too. My
>co-worker is getting 39, and then 23 while I am getting 276 and then 158.
>Thats "alittle bit" of a difference. :(
>"Sue Hoegemeier" wrote:
>> 1. Something like:
>> select *
>> from master..syscacheobjects
>> where sql like '<beginning of your sql statement> %'
>> 2. Display the execution plan for the query on each PC. If
>> there is a difference, that might lead you to the issue.
>> In Query Analyzer, from the menu go to Query and select
>> Display Estimated Execution Plan.
>> -Sue
>> On Tue, 3 Oct 2006 12:40:02 -0700, Karl
>> <Karl@.discussions.microsoft.com> wrote:
>> >How do I find my specific query in syschacheobjects? There's 20,000 items in
>> >there or so.........
>> >
>> >And what do you mean by differences in the execution plans on each PC? I
>> >guess I don't get what your asking here.
>> >
>> >Thanks so much for you help so far!!
>> >
>> >(waiting for the other user to get back to run the selects seperately)
>> >
>> >"Sue Hoegemeier" wrote:
>> >
>> >> Any differences when you look at the two in syscacheobjects?
>> >> I would guess you would find two different bucket ids to
>> >> identify them - you might get some clues with the values
>> >> there.
>> >> Any differences when you look at the execution plans on each
>> >> PC?
>> >>
>> >> Other than that, have you tried just first executing each
>> >> select that are being unioned to narrow it down some? Or are
>> >> both results different on the two machines where you can
>> >> reproduce this issue.
>> >>
>> >> -Sue
>> >>
>> >> On Tue, 3 Oct 2006 09:00:01 -0700, Karl
>> >> <Karl@.discussions.microsoft.com> wrote:
>> >>
>> >> >Sue - good thoughts. This is happening all across out network. Some
>> >> >machines get 35 results and some get 189. We noticed because we switched
>> >> >from Crystal X to Crystal XI (they are on different servers).
>> >> >
>> >> >The connection settings in query analyzer are the same. All default. :(
>> >> >Good thought, I didn't think to check there.
>> >> >
>> >> >This also happens when querying through ODBC connections. And query
>> >> >analyzer. I don't even know where to begin. :(
>> >> >
>> >> >Any more ideas?
>> >> >
>> >> >And thanks so much for replying!
>> >> >
>> >> >"Sue Hoegemeier" wrote:
>> >> >
>> >> >> If you both are executing this through Query Analyzer, I'd
>> >> >> start by making sure you have the same connection settings,
>> >> >> properties on both PCs. From the menu in Query Analyzer,
>> >> >> Tools -> Options.
>> >> >>
>> >> >> -Sue
>> >> >>
>> >> >> On Mon, 2 Oct 2006 16:41:01 -0700, Karl
>> >> >> <Karl@.discussions.microsoft.com> wrote:
>> >> >>
>> >> >> >So...we have a SQL server and we are using a query to build a basis for a
>> >> >> >report. We just recently noticed that depending on which machine you run the
>> >> >> >query from you get a different answer.
>> >> >> >
>> >> >> >Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
>> >> >> >Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
>> >> >> >
>> >> >> >She gets like 6 returns and I get 189. What would casuse this? Where
>> >> >> >should I start looking?
>> >> >> >
>> >> >> >Here's the query:
>> >> >> >
>> >> >> >
>> >> >> >SELECT P.CREATEDDT, P.CREATEDBY,
>> >> >> > 'MEASURE' OBJECT_TYPE,
>> >> >> > P.PROJECTID OBJECTID,
>> >> >> > P.PROJECTID,
>> >> >> > P.TITLE,
>> >> >> > ' ' OTHER,
>> >> >> > 'Missing Make Model or Serial' ERROR,
>> >> >> > P.PMC,
>> >> >> > TS.STATUS,
>> >> >> > TS.TRANSACTIONID,
>> >> >> > ''OTHER_PROJ,''OTHER_TITLE
>> >> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN ('MAKE','MODEL','SERIAL'))
>> >> >> >ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
>> >> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
>> >> >> > ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
>> >> >> > LMI.INCENTIVEID = TS.INCENTIVEID
>> >> >> >WHERE P.PROJECTID IN(
>> >> >> >SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >> >> > ATT.MEASUREID = ACS.MEASUREID
>> >> >> >WHERE ACS.CATEGORY IN ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
>> >> >> > 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
>> >> >> > 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
>> >> >> > 'FHEDISHG')
>> >> >> >AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
>> >> >> >AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
>> >> >> > AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
>> >> >> ><>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>> >> >> >AND IMPORTEDDT IS NULL
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >UNION
>> >> >> >
>> >> >> >SELECT *,
>> >> >> >
>> >> >> > (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >> >> >ATT.MEASUREID = ACS.MEASUREID
>> >> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
>> >> >> > (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
>> >> >> >ATT.MEASUREID = ACS.MEASUREID
>> >> >> > INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
>> >> >> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
>> >> >> >FROM
>> >> >> >(SELECT P.CREATEDDT,P.CREATEDBY,
>> >> >> > 'MEASURE' TYPE,
>> >> >> > ATT.MEASUREID,
>> >> >> > P.PROJECTID,
>> >> >> > P.TITLE,
>> >> >> > ATTRVALUE OTHER,
>> >> >> > 'Duplicate Serial Numbers' ERROR,
>> >> >> > P.PMC,
>> >> >> > TS.STATUS,
>> >> >> > TS.TRANSACTIONID
>> >> >> >FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
>> >> >> >ACTIONSUMMARY ACS ON
>> >> >> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
>> >> >> > ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
>> >> >> > P.PROJECTID = TS.PROJECTID
>> >> >> >WHERE ATTRVALUE IN
>> >> >> >(SELECT ATTRVALUE FROM ACTIONATTR
>> >> >> >WHERE ATTRNAME IN ('SERIAL')
>> >> >> >AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
>> >> >> >GROUP BY ATTRVALUE
>> >> >> >HAVING COUNT(ATTRVALUE) >1)
>> >> >> >AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
>> >> >> ><>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
>> >> >> >AND IMPORTEDDT IS NULL)K
>> >> >> >
>> >> >>
>> >> >>
>> >>
>> >>
>>|||Shot in the dark...
- Drop all indexes and recreate them
or
- Create tables with the same columns as the tables involved, but with
different table names. Export data out of the tables involved and load into
the new tables. Rewrite the query to use the new tables and see if there is
any different results.
Also, if I recall, there is a utility on the MDAC page that checks the
version of all MDAC components. See if anything strange is reported.
"Karl" <Karl@.discussions.microsoft.com> wrote in message
news:467A9CF7-0739-43D9-98E8-EC62BE9A8806@.microsoft.com...
> So...we have a SQL server and we are using a query to build a basis for a
> report. We just recently noticed that depending on which machine you run
> the
> query from you get a different answer.
> Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> She gets like 6 returns and I get 189. What would casuse this? Where
> should I start looking?
> Here's the query:
>
> SELECT P.CREATEDDT, P.CREATEDBY,
> 'MEASURE' OBJECT_TYPE,
> P.PROJECTID OBJECTID,
> P.PROJECTID,
> P.TITLE,
> ' ' OTHER,
> 'Missing Make Model or Serial' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID,
> ''OTHER_PROJ,''OTHER_TITLE
> FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN
> ('MAKE','MODEL','SERIAL'))
> ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> LMI.INCENTIVEID = TS.INCENTIVEID
> WHERE P.PROJECTID IN(
> SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> WHERE ACS.CATEGORY IN
> ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
> 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
> 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
> 'FHEDISHG')
> AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> AND IMPORTEDDT IS NULL
>
> UNION
> SELECT *,
> (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID
> INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> FROM
> (SELECT P.CREATEDDT,P.CREATEDBY,
> 'MEASURE' TYPE,
> ATT.MEASUREID,
> P.PROJECTID,
> P.TITLE,
> ATTRVALUE OTHER,
> 'Duplicate Serial Numbers' ERROR,
> P.PMC,
> TS.STATUS,
> TS.TRANSACTIONID
> FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> ACTIONSUMMARY ACS ON
> ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> P.PROJECTID = TS.PROJECTID
> WHERE ATTRVALUE IN
> (SELECT ATTRVALUE FROM ACTIONATTR
> WHERE ATTRNAME IN ('SERIAL')
> AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> GROUP BY ATTRVALUE
> HAVING COUNT(ATTRVALUE) >1)
> AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> <>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> AND IMPORTEDDT IS NULL)K
>|||I'll have to try the indexes.........good thought. Its HUGE tables
something could be outta whack...
I downloaded CCcheck from the MS website and the MDACs are the same.
"JJ" wrote:
> Shot in the dark...
> - Drop all indexes and recreate them
> or
> - Create tables with the same columns as the tables involved, but with
> different table names. Export data out of the tables involved and load into
> the new tables. Rewrite the query to use the new tables and see if there is
> any different results.
> Also, if I recall, there is a utility on the MDAC page that checks the
> version of all MDAC components. See if anything strange is reported.
>
> "Karl" <Karl@.discussions.microsoft.com> wrote in message
> news:467A9CF7-0739-43D9-98E8-EC62BE9A8806@.microsoft.com...
> > So...we have a SQL server and we are using a query to build a basis for a
> > report. We just recently noticed that depending on which machine you run
> > the
> > query from you get a different answer.
> >
> > Me = WinXpSp2 MDAC 2.8sp1 Retrieving incorrect results
> > Coworker= WinXpSp2 MDAC 2.8sp1 Retrieves teh correct results
> >
> > She gets like 6 returns and I get 189. What would casuse this? Where
> > should I start looking?
> >
> > Here's the query:
> >
> >
> > SELECT P.CREATEDDT, P.CREATEDBY,
> > 'MEASURE' OBJECT_TYPE,
> > P.PROJECTID OBJECTID,
> > P.PROJECTID,
> > P.TITLE,
> > ' ' OTHER,
> > 'Missing Make Model or Serial' ERROR,
> > P.PMC,
> > TS.STATUS,
> > TS.TRANSACTIONID,
> > ''OTHER_PROJ,''OTHER_TITLE
> > FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME IN
> > ('MAKE','MODEL','SERIAL'))
> > ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> > ACS.PROJECTID = P.PROJECTID LEFT JOIN LINK_MEAS_INCENT LMI ON
> > ACS.MEASUREID = LMI.MEASUREID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> > LMI.INCENTIVEID = TS.INCENTIVEID
> > WHERE P.PROJECTID IN(
> > SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID
> > WHERE ACS.CATEGORY IN
> > ('ECWEE142','ECWEE16','ECWEE18','ECWEG142','ECWEG16',
> > 'ECWEG18','ECWGE142','ECWGE16','ECWGE18','ECWGG142',
> > 'ECWGG16','ECWGG18','EHADISHE','EHADISHG','FHEDISHE',
> > 'FHEDISHG')
> > AND ATTRNAME IN ('MAKE','MODEL','SERIAL')
> > AND (ATTRVALUE IS NULL OR ATTRVALUE=''))
> > AND P.STATUS <>'ABANDON' AND P.PMC = 'HP' AND P.PROJECTID
> > <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> > AND IMPORTEDDT IS NULL
> >
> >
> >
> > UNION
> >
> > SELECT *,
> >
> > (SELECT PROJECTID FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID
> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_PROJ,
> > (SELECT TITLE FROM ACTIONATTR ATT INNER JOIN ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID
> > INNER JOIN PROJECT P ON ACS.PROJECTID = P.PROJECTID
> > WHERE ATTRVALUE =OTHER AND ATT.MEASUREID <>K.MEASUREID)OTHER_TITLE
> > FROM
> > (SELECT P.CREATEDDT,P.CREATEDBY,
> > 'MEASURE' TYPE,
> > ATT.MEASUREID,
> > P.PROJECTID,
> > P.TITLE,
> > ATTRVALUE OTHER,
> > 'Duplicate Serial Numbers' ERROR,
> > P.PMC,
> > TS.STATUS,
> > TS.TRANSACTIONID
> > FROM (SELECT * FROM ACTIONATTR WHERE ATTRNAME = 'SERIAL') ATT INNER JOIN
> > ACTIONSUMMARY ACS ON
> > ATT.MEASUREID = ACS.MEASUREID INNER JOIN PROJECT P ON
> > ACS.PROJECTID = P.PROJECTID LEFT JOIN VIEW_TRANSACTION_SUM TS ON
> > P.PROJECTID = TS.PROJECTID
> > WHERE ATTRVALUE IN
> > (SELECT ATTRVALUE FROM ACTIONATTR
> > WHERE ATTRNAME IN ('SERIAL')
> > AND ATTRVALUE IS NOT NULL AND ATTRVALUE <> ' '
> > GROUP BY ATTRVALUE
> > HAVING COUNT(ATTRVALUE) >1)
> > AND ATTRNAME IN ('HEFSERIAL', 'SERIAL') AND P.PMC = 'HP' AND P.STATUS
> > <>'ABANDON' AND P.PROJECTID <>'P00000000817'ANd P.PROGRAMCODE <>'DYS'
> > AND IMPORTEDDT IS NULL)K
> >
> >
>
>sql