Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 What does it mean if a query just never ends?

Author  Topic 

meanmyrlin
Starting Member

15 Posts

Posted - 2008-12-10 : 19:40:31
Hello,

I am running the query:

Select

IPF.AlgCode, IPF.ChromeStyleid, IPF.NcodeL, IPF.NcodeM, IPF.NcodeR, IPF.SaleYR, IPF.SaleMo, VIN, SaleType,
Default_State, IPF.ModelYear, AlgMake, AlgModel, AlgStyle, ExteriorColor, Mileage, Transmission, SellingPrice, SalesCost, GrossProfit, DaysAtDealerShip, AgeInMo, LogDaysAtDealership,
MileAdjPrice15K, MileAdjPrice21K, SampleSize, AvgDaysAtDealership, AvgMileAdjPrice, AvgLogDaysAtDealer,

((DaysAtDealerShip-AvgDaysAtDealership)*(MileAdjPrice15K-avgmileadjprice)) /
(power((DaysAtDealerShip-AvgDaysAtDealership), 2))AS SumForLinearAdj,

((LogDaysAtDealerShip-AvgLogDaysAtDealer)*(MileAdjPrice15K-avgmileadjprice)) /
(power((LogDaysAtDealerShip - AvgLogDaysAtDealer), 2)) AS SumForLogLinearAdj

From

dbo.inventoryProTEST IPF

inner join


(Select

AlgCode, ChromeStyleid, NcodeL, NcodeM, NcodeR, SaleYR, SaleMo, Count(vin)AS SampleSize,
ModelYear, Avg(DaysAtDealership) AS AvgDaysAtDealership, Avg(MileAdjPrice15K) AS AvgMileAdjPrice,
Avg(LogDaysAtDealership) AS AvgLogDaysAtDealer

From

dbo.inventoryproformatted

Group by

AlgCode, ChromeStyleid, NcodeL, NcodeM, NcodeR, SaleYR, SaleMo, ModelYear) Averages

on

ipf.algcode = averages.algcode and
ipf.chromestyleid = averages.chromestyleid and
ipf.ModelYear=averages.modelyear and
ipf.SaleMo = Averages.salemo and
ipf.saleyr = averages.saleyr

While I haven't received any errors this query has been running for over three hours with no results. I have tried running it on both a large dataset and a small sample of data and I am still not getting any results.I am not sure what to do now. Could anyone offer me some advice?

Thank you for your help.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-10 : 19:46:21
Is your session blocked by another session? Run sp_who/sp_who2 or check master.dbo.sysprocesses.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

meanmyrlin
Starting Member

15 Posts

Posted - 2008-12-10 : 19:51:05
That could be a possibility. I'll check that. Thank you.
Go to Top of Page
   

- Advertisement -