SQL Server Diagnostic Information Queries for October 2013

I have made some minor updates and bug fixes for all of my SQL Server Diagnostic Information Queries for this month. 

Rather than having a separate blog post for each version, I’ll just put the links for all five versions here.

SQL Server 2005 Diagnostic Information Queries        SQL Server 2005 Blank Results

SQL Server 2008 Diagnostic Information Queries        SQL Server 2008 Blank Results

SQL Server 2008 R2 Diagnostic Information Queries  SQL Server 2008 R2 Blank Results

SQL Server 2012 Diagnostic Information Queries        SQL Server 2012 Blank Results

SQL Server 2014 Diagnostic Information Queries        SQL Server 2014 Blank Results

About half of the queries are instance specific and about half are database specific, so you will want to make sure you are connected to a database that you are concerned about instead of the master, system database.

The idea is that you would run each query in the set, one at a time (after reading the directions). You need to click on the top left square of the results grid to select all of the results, and then right-click and select “Copy with Headers” to copy all of the results, including the column headers to the Windows clipboard. Then you paste the results into the matching tab in the spreadsheet. There are also some comments on how to interpret the results after each query.

Note: These queries are stored on Dropbox. I occasionally get reports that the links to the queries and blank results spreadsheets do not work, which is most likely because Dropbox is blocked wherever people are trying to connect.

I also occasionally get reports that some of the queries simply don’t work. This usually turns out to be an issue where people have some databases in 80 compatibility mode, which breaks many DMV queries.

Please let me know what you think of these queries.

This entry was posted in Diagnostic Queries, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014 and tagged , . Bookmark the permalink.

15 Responses to SQL Server Diagnostic Information Queries for October 2013

  1. Glen,

    If you update your scripts so often, you should consider posting them to github or bitbucket. It would also make it easier for people to comment on them and suggest improvements..

  2. Pingback: My links of the week – October 20, 2013 | R4

  3. Rob says:

    Using SSMS 2012 (11.0.3000.0) on SQL Server 2005 (9.00.3080.00).
    Just starting to use these scripts, but I found an issue with the 2005 version on one of my test servers. In the first check for the major product version, I get the following error:

    Msg 156, Level 15, State 1, Line 3
    Incorrect syntax near the keyword ‘convert’.
    Msg 137, Level 15, State 2, Line 4
    Must declare the scalar variable “@ProductVersion”.

    I found the cause was the declaration line in the BEGIN…END section. It doesn’t like declaring and setting the variable in one statement. If I end the statement after the declaration and begin with a SET statement on the next line, the script is fine:

    DECLARE @ProductVersion varchar(128);
    SET @ProductVersion = convert(varchar(128), SERVERPROPERTY(‘ProductVersion’));

    When I fix that line, the code executes but erroneously reports that the “Script does not match the ProductVersion [9.00.3080.00] of this instance.” I changed the ‘90%’ snippet to ‘9%’ to fix the issue.

  4. Pontus says:

    Keep up the good work Glenn!, these scripts are a massive time saver!

  5. Query 27 for the 2005 script gives a syntax error on SQL Server 2005 SP3 (yes, I know it needs to be upgraded to SP4 – not my server 🙂 ). It doesn’t like DB_ID() in sys.dm_io_virtual_file_stats(DB_ID(), NULL) for some reason.

    Keep up the good work! Really appreciate these scripts.

    Thanks
    David

  6. Nevermind the above comment – the database was in compatibility mode 80. My apologies.

    Thanks
    David

  7. Big thank you Glenn for the scripts! Massive help!! It really streamlined my regular task.
    I got a question; I’ve watched you presentation on PASS Summit (How to Use DMVs to Diag…). It is with re to fragmentation information. During your presentation you mentioned that “a really good solution for your fragmentation” are scripts. I can’t quite catch the name behind those scripts. Could you please reply with info who’s scripts are best for managing fragmentation?
    Big thanks,
    Tom

  8. Max Vernon says:

    Thanks for such a great resource, Glenn. Love your SQL Server Hardware book, by the way!

  9. Pingback: SQL Server – Diagnostic Information Queries (2005/2008/2012) | Alex Souza

  10. hashedupit says:

    I’ve just started a new job and you’ve made me look so competent at blasting through their SQL servers identifying things that need improvement! Many thanks for helping out the world one query at a time. You should setup and honesty box. I’ll have happily chucked in a few dollars for the time and effort you’ve put into the scripts that you’ve saved me. Hey you could even donate the money to your favourite charity if you didn’t feel comfortable with it going to you directly. You help us, we help you, help your charity. That just keeps the good vibes rolling and perpetuates the karma. Good job Glenn. Very Good Job indeed. Respect.

Leave a comment