|
Question : Why does MS SSRS 2005 Hang On Query?
|
|
I've created a report using SSRS 2005 against a SQL 2000 db and when I try to run the query for this one report I'm working on, it hangs indefinitely until I end task. The report accesses the data via a stored procedure and has no problem updating fields. But when I try to run the query in the data section it hangs. The query/SP runs fine in SQL Server Management Studio Express--takes about 30 seconds to return results. It returns 4 rows of about 25 fields each. I am not using any temp tables or table variables--just a few aliased subqueries. There's no unions or cursors. For approximately 20 fields I use a double-nested Case. The Stored Procedure query contains the following basic elements (this is just pseudo code, obviously) @Date1 Datetime, @Date2 Datetime AS SET NOCOUNT ON; SELECT Product --There are about 20 fields returned in the same manner as this: , Sum(CASE Excptn WHEN 1 THEN 0 ELSE CASE WHEN DateDiff(day, RecvDate, ShipDate) > 10 THEN 1 ELSE 0 END END) as RcvShp_GT10 FROM (Subquery with Grouping that selects from (This subquery) ZZZ Left join (This subquery) YYY ON ZZZ.Fkey = YYY.Key Where date between @Date1 and @Date2 ) SubQueryName WHERE date between @Date1 and @Date2 Group by Product Unless SSRS simply has an aversion to nested Case statements, there seems to be no reason it shouldn't be working. I'm stumped. Any thoughts?
|
|
Answer : Why does MS SSRS 2005 Hang On Query?
|
|
Found solution. It had nothing to do with the SQL, but the SSRS itself. It turns out the request was never even reaching SQL. SSRS was hanging client side without ever getting to the point of making a request to SQL. It was a result of making a change to the data source (making it a stored procedure after having embedded the code originally and using the "Text" option). One would think that simply changing "Text" to "Stored Procedure" and entering the SP would work, but it doesn't.
It turns out SSRS can't handle the change. The solution was do delete the data source entirely and create a new one--specifying "Stored Procedure" and entering the name of the SP.
|
|
|
|