|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, August 26, 2010 9:34 AM
Points: 4,
Visits: 36
|
|
I had to add
END GO
to the end of the code too. It appears to be missing on the web page.
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 1:14 AM
Points: 31,433,
Visits: 13,746
|
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 6:22 AM
Points: 47,
Visits: 762
|
|
Hi,
from the feedback, I’m not sure if people have understood this article completely.
The article discusses how to identify queries that are running slower than normal i.e. ones that seem to have degraded in performance. It is not about finding slow queries per se.
If you want to discover which queries are taking the longest to run (in terms of duration or IO), look at the sections entitled “Costly Queries by CPU”, and “Costly Queries by I/O”, in my MSDN article here: http://msdn.microsoft.com/en-us/magazine/cc135978.aspx
Thanks Ian
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 2:04 AM
Points: 4,430,
Visits: 7,210
|
|
Good article, Ian. Ignore those ignorant enough to criticise without giving a reason. And to those who carp about bugs in the code, I say this: Debug it yourself! You'll learn by doing this. Incorrect syntax? Use Books Online to find out what the correct syntax is. Divide by zero error? Put in your own CASE statement to stop this. Carriage returns lost when copying and pasting? Put them back in. Honestly, whenever I post code I'm half tempted to put deliberate errors in it so that people don't just copy it and use it without thinking about it.
John
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, January 14, 2009 2:47 AM
Points: 1,
Visits: 3
|
|
I created the proc and executed it. Got the following:
Msg 8134, Level 16, State 1, Procedure dba_QueryTimeDelta, Line 25 Divide by zero error encountered. The statement has been terminated.
(0 row(s) affected)
(0 row(s) affected)
Any quick fixes available? Nick
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, January 20, 2012 4:42 PM
Points: 5,
Visits: 38
|
|
| For a SQL 2000 tool google sp_who_3 written by Mike Barzilli.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Yesterday @ 9:22 AM
Points: 246,
Visits: 64
|
|
Same here. I've ensured that the code pasted correctly, there are no bad characters and so on. But I'm also getting a divide by zero error - I'm assuming this in the first CASE statement, but I don't have time to debug that right now. Interesting concept, though.
Buck Woody MCDBA, MCSE, Novell and Sun Certified
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 6:22 AM
Points: 47,
Visits: 762
|
|
Hi,
please see a previous discussion entry by jacroberts, he has the relevant code to prevent the divide by zero error.
thanks Ian
|
|
|
|