Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL 2005 Query Hangs and never returns results. If i update Stats it runs

Posted on 2006-07-20
3
Medium Priority
?
592 Views
Last Modified: 2010-05-18
Heres the query


SELECT ve2.ID, ve3.VALUE_AS_STRING, ve5.VALUE_AS_TEXT, ve7.VALUE_AS_STRING, ve9.VALUE_AS_STRING,
ve11.VALUE_AS_STRING
FROM tblGRNT ve0 INNER JOIN tblGRNT2 ve1 ON ve1.GRANTEE_VEOID = ve0.VEOID
  INNER JOIN tblD)ve2 ON ve2.VEOID = ve1.DATAOBJECT_VEOID
  INNER JOIN tblDAve3 ON ve3.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve4 ON ve4.VEOID = ve3.METAATTRIBUTE_VEOID
  INNER JOIN tblDAve5 ON ve5.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve6 ON ve6.VEOID = ve5.METAATTRIBUTE_VEOID
  INNER JOIN tblDAve7 ON ve7.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve8 ON ve8.VEOID = ve7.METAATTRIBUTE_VEOID
  INNER JOIN tblDAve9 ON ve9.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve10 ON ve10.VEOID = ve9.METAATTRIBUTE_VEOID
  INNER JOIN tblDAve11 ON ve11.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve12 ON ve12.VEOID = ve11.METAATTRIBUTE_VEOID
WHERE ve0.VEOID = 201 AND ve4.MET_NAME = 'ID' AND ve6.MET_NAME = 'PROJECT_TITLE'
  AND ve8.MET_NAME = 'AWARD_DATE' AND ve10.MET_NAME = 'GRANT_AMOUNT' AND ve12.MET_NAME = 'PAID_AMOUNT'
0
Comment
Question by:Mikal613
  • 2
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 17147321
I hope you have all the indexes on the fields that are in the join conditions
0
 
LVL 48

Author Comment

by:Mikal613
ID: 17147329
how do i check that?

(Hey angel long time no speak)
0
 
LVL 48

Author Comment

by:Mikal613
ID: 17154425
You were right can you tell me why it had to be that way?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question