Solved

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

Posted on 2006-07-20
3
532 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 142

Accepted Solution

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

Author Comment

by:Mikal613
Comment Utility
how do i check that?

(Hey angel long time no speak)
0
 
LVL 48

Author Comment

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now