Debugger For SQL

  • Wouldnt it be nice if we have a debugger in Management Studio to debug SQL Commands Just like we debug .NET Programs.

    Do you think of any new features which would be helpful

  • Arun (8/11/2008)


    Wouldnt it be nice if we have a debugger in Management Studio to debug SQL Commands Just like we debug .NET Programs.

    Your wish has already been answered. There's a built-in debugger in SQL 2008's management studio. 🙂

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for letting me know that do you have any article on this ?

  • I don't, but if you google you should be able to find some blog posts about it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Do you think of any new features which would be helpful

    Personally - since 6.5, I've been waiting for the ability to write a view, and then, when I open it again, it's actually in the same damn format, rather than having been munged beyond recognition to total unreadability :angry:

    I'm a DBA.
    I'm not paid to solve problems. I'm paid to prevent them.

  • andrew gothard (8/11/2008)


    Do you think of any new features which would be helpful

    Personally - since 6.5, I've been waiting for the ability to write a view, and then, when I open it again, it's actually in the same damn format, rather than having been munged beyond recognition to total unreadability :angry:

    :ermm: How are you opening the views? (management studio)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Well - usually in QA once it's written. Prototype in MS - then you get that sinking feeling when a colleague comes up to you baffled that someone normally so arsey about layout suddenly seems to have started setting out code like an inebriated baboon ......

    Personal view is that if you set out code in a certain way, that should be maintained however you open it. And thinking about it, my irritation with Microsoft in this respect goes back to Access version 1.0

    I'm a DBA.
    I'm not paid to solve problems. I'm paid to prevent them.

  • Just a note.

    In sql 2000 you could install an add in to be able to debug ( been a long time).

    In 2005 you can debug the procedures ect in visual studio or SQL Server business Inteligence development studio.

  • As far as I know you could debug using a SQL Profiler to see whats going on. Can you set a break point and see what the current value of a variable is ? (Like VS.NET ) I will be googling around to see what SQL 2008 actually has for us.

  • Joel,

    You were right, here is a good example on SQL 2005

    http://aspnet.4guysfromrolla.com/articles/051607-1.aspx

  • andrew gothard (8/12/2008)


    Well - usually in QA once it's written. Prototype in MS - then you get that sinking feeling when a colleague comes up to you baffled that someone normally so arsey about layout suddenly seems to have started setting out code like an inebriated baboon ......

    Personal view is that if you set out code in a certain way, that should be maintained however you open it. And thinking about it, my irritation with Microsoft in this respect goes back to Access version 1.0

    I'm still puzzled. Access was well known for rearranging code, but I have never had SQL Server reorganise a view or stored proc of mine. It stores the creation script within the system tables (syscomments on 2000, sys.sql_modules on 2005)

    I tested this out on SQL 2005, using management studio. I created the following monstrosity of bad layout:

    CREATE VIEW PerverseLayout AS

    SELECT

    [name], create_date

    FROM

    sys . objects WHERE

    type = 'U '

    GO

    Then went to object explorer, right clicked the view and chose edit. Script generated with exactly the same format.

    Then I went to object explorer, right click, script object and scripted both the create and the alter, and both came back with exactly the same format I created the view with.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Choose DESIGN next time instead of EDIT and the designer will rearrange your query in SQL Server 2005.


    N 56°04'39.16"
    E 12°55'05.25"

  • I tested this out on SQL 2005, using management studio. I created the following monstrosity of bad layout:

    CREATE VIEW PerverseLayout AS

    SELECT

    [name], create_date

    FROM

    sys . objects WHERE

    type = 'U '

    GO

    Then went to object explorer, right clicked the view and chose edit. Script generated with exactly the same format.

    Then I went to object explorer, right click, script object and scripted both the create and the alter, and both came back with exactly the same format I created the view with.

    It's the query designer that mungs your code - and the format is no better than your example.

    I'm a DBA.
    I'm not paid to solve problems. I'm paid to prevent them.

  • andrew gothard (8/12/2008)


    Well - usually in QA once it's written. Prototype in MS - then you get that sinking feeling when a colleague comes up to you baffled that someone normally so arsey about layout suddenly seems to have started setting out code like an inebriated baboon ......

    Personal view is that if you set out code in a certain way, that should be maintained however you open it. And thinking about it, my irritation with Microsoft in this respect goes back to Access version 1.0

    The layout will stay consistent unless you open it in the GUI query designer. Since that tool also tends to break certain types of queries by rewriting them without telling you, after you click Save, I don't use it.

    When you want to edit a view or other query, don't use Design, use Edit. Your layout will stay the way you left it.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • andrew gothard (8/12/2008)


    Well - usually in QA once it's written. Prototype in MS - then you get that sinking feeling when a colleague comes up to you baffled that someone normally so arsey about layout suddenly seems to have started setting out code like an inebriated baboon ......

    Personal view is that if you set out code in a certain way, that should be maintained however you open it. And thinking about it, my irritation with Microsoft in this respect goes back to Access version 1.0

    Yeah, that's the View/Query Designer. It's awful and NO ONE should EVER use it. (there's another one of those rules, again)

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

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

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