'Debugging Query' for a long time...

  • I am trying to run a simple select query in SQL Server 2008 that I have run many, many times in SQL 2000 and it appears to be stuck 'debugging query' for about 7 minutes now. Should I be doing something differently??? This is a new server and a new installation of SQL so I may have missed something. Thank you in advance for your help!!!

  • Have you checked statistics, execution plans, indexes? Have you checked for blocking? Do you have any traces running?

    Please provide the query and actual execution plan - better answers could be provided after that.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I was able to get it to run by clicking on 'Debug' then 'Continue' on the menu bar. Is there some way to bypass the 'Debug' step??? I don't remember that step from the class that I took.

  • Did you add any breakpoints?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • No...the query is

    SELECT * from Table where ColumnName = 'Y'

  • There should have been no need to hit continue on the query.

    EDIT: fixed typo.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Please forgive my ignorance but I don't know what you mean...what 'node'???

  • Typo

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I see...that's what I thought. Maybe I did something wrong during the install or maybe there is something that I need to turn off to prevent this from happening again??? I just tested a couple of other simple select queries and it happens on all of them.

  • In SSMS, are you pressing the Green Triangle, or the Red Exclamation Point?

    The Green Triangle is to run in Debug mode, the Red Exclamation Point executes the query. You want to do the Red Exclamation Point...;-)

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Very interesting. It doesn't do that on mine but apparently it is supposed to be the default behavior.

    http://technet.microsoft.com/en-us/library/cc646024.aspx

    When debugging transact-sql statements it stops by default on the first line of code.

    Try placing a comment on the first line and then copy the code to a new line below the commented out code and see if it tricks it - frankly just curious.

    I just tried that myself and it seemed to have an effect (I was finally able to reproduce what you are seeing.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • WayneS (4/14/2010)


    In SSMS, are you pressing the Green Triangle, or the Red Exclamation Point?

    The Green Triangle is to run in Debug mode, the Red Exclamation Point executes the query. You want to do the Red Exclamation Point...;-)

    They do want to run in Debug is my understanding. I find it to be somewhat odd behavior.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • CirquedeSQLeil (4/14/2010)


    WayneS (4/14/2010)


    In SSMS, are you pressing the Green Triangle, or the Red Exclamation Point?

    The Green Triangle is to run in Debug mode, the Red Exclamation Point executes the query. You want to do the Red Exclamation Point...;-)

    They do want to run in Debug is my understanding. I find it to be somewhat odd behavior.

    I didn't see anything in the post that said they wanted to run in debug mode... and they did mention going from 2000 to 2008. SQL-EM didn't have the debug mode (from what I remember), and it would be easy to click the debug Green Triangle, thinking it would just run the query. I might be wrong, but thought I would throw it out there. (Last week, I actually did this, after spending most of the day in BIDS, I went to run a query and hit the Green Triangle... took me a while to figure out why it was all funky... 🙁 )

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Wayne - Thank you!!! That is the answer I was looking for. CirquedeSQLeil, I'm sorry if I was unclear. My only experience with SQL up until a week ago was with SQL 2000 (and a 2 day class several months ago) where we used only the Green Triangle, not the Red Exclamation Point (that has 'Execute' next to it...doh!!!). Guess that's why I posted this in the newbie forum. Thank you both for your time...and patience!!!

  • Guess I was wrong. I interpreted the problem to be that debugging was taking too long and that you wanted to debug.

    Glad you found your answer.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply