Getting the Most Out of SQL Server 2000's Query Analyzer, Part II

  • Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/bkelley/qa2k_2_1.asp

    K. Brian Kelley
    @kbriankelley

  • Brian,

    What permissions are required (both on SQL Server and for NT) to allow a developer to debug a stored procedure (for both SQL7 and SQL2K)?

    Thanks

    Chad

  • I had not noticed the debugger. Thank you.

    Have you noticed the ability to save while developing a query in the enterprise manager? I did, but the save does not prompt for a file name? Perhaps it is for future use.

    Lon

  • save always works. I use this every day in development. It defaults to "untitledxx", but there is the ability to change that. Have you tried "save as"?

    Steve Jones

    steve@dkranch.net

  • Brian,

    Great Article.

    About the debugger,I have been unable to run in anywhere but directly on the query analyzer on the server. MSDN mentioned something about a bug. Have you experienced this?

    Lou

  • Hi Lou,

    I have not. I am in the process of trying to research it. A friend of mine is also having issues (chad) and we're trying to nail down the exact permissions and settings required for the various SQL Server versions. One thing we have noticed is there is a definite difference between 7 and 2000.

    K. Brian Kelley

    bkelley@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/bkelley/

    K. Brian Kelley
    @kbriankelley

  • Hi Brian Kelley,

    The article is very informative. I tried the dubugging process in my server, it is sql2000 server which runs under the Win2k OS. When i try to debug the sp it says "Sp debugging may not work properly if you log on as 'Local System account' while SQL Server is configured to run as a service. You can open Event Viwer to see details

    Do you wish to continue ? " and if i continues with this it executes and gives the result of the procedure and i can not able to start the debugging process after placing the breakpoint, it just executes the procedure and gives the result of the same . I was not able to use the debug commands (sep in, step out etc.,). What could be the problem. Looking forward for your reply.

    Regards,

    Lingasamy K

  • Brian take a look at this article. I was having problems until I did this :

    http://support.microsoft.com/default.aspx?scid=KB;en-us;270061&

    Tim C.

    //Will write code for food


    Tim C //Will code for food

  • Excellent. I hope there will be more information about the templates in future articles. They are a fantastic tool for encouraging some naming and development standards. I know that is a hot topic around here

    [font="Tahoma"]Bryant E. Byrd, BSSE MCDBA MCAD[/font]
    Business Intelligence Administrator
    MSBI Administration Blog

  • I keep finding more gems in this great tool, Query Analyzer. Here are two additional tips:

    1. With the default settings, using the Object Browser for scripting creates what is for me a lot of "noise" in the script. For example, scripting a table will give you something like:

    CREATE TABLE [Region] (

     [RegionID] [int] NOT NULL ,

     [RegionDescription] [nchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

     CONSTRAINT [PK_Region] PRIMARY KEY  NONCLUSTERED

     (

      [RegionID]

    &nbsp  ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    All those brackets and the collation clauses get in the way for me. Fortunately, you can control a lot of this by going to Tools/Options and clicking on the Script tab.  I usually pick "None" as Identifier delimeter and check the "Do not script collation clause ...." option. With these two settings changed, I get the following (in my opinion, cleaner) result:

    CREATE TABLE Region (

     RegionID int NOT NULL ,

     RegionDescription nchar (50) NOT NULL ,

     CONSTRAINT PK_Region PRIMARY KEY  NONCLUSTERED

     (

      RegionID

    &nbsp  ON PRIMARY

    ) ON PRIMARY

    GO

    2. Got a stored procedure that has lots of parameters that you want to test? Just right-click on it in the Object Browser and select "Open". You get a nice little "Execute Procedure" dialog box that lists all the parameters, shows their datatypes, and allows you to enter parameter values. Then click the "Execute" button to run the stored procedure. Pretty slick!

    A very good article, Brian - good on ya for spreading the word about the many features in this great freebee from Microsoft.

    Best regards,

    SteveR

     

  • Hi Brian Kelly,

    yes, excellent article and v. informative.

    I am unable to use my debugger. After successfully setting parameters etc, the new debugger window opens, but I do not have the following facilities -

    Step into, over, out, run to cursor, restart, stop debugging are all disabled. The locals, globals and call stack windows are all empty.

    I only have the option to Go (F5) or to set break points which it does not stop at.

    I do not get any error messages either. I am running this on Windows XP.

    Is there some setting that I have missed?

    Many thanks,

    Polly

  • Where is the SQL Server installed? And what service pack is it?

    K. Brian Kelley
    @kbriankelley

  • Hi Brian,

    I have version SQL 8.00.194

    SQL Distributed Management Framework (SQL DMF)

    and it is installed on my local pc which has Windows XP Professional Version 2002 SP2 installed on it.

    Thank you for your help.

    Kind regards,

    Polly

  • hello friends,

    i am newcomer pls help me..

    question->

    table 1 table 2

    col0 col1 col2 col3 col0 col1

    abc def geh ijk abc def

    abc1 def1 geh1 ijk1 abc geh

    abc ijk

    abc1 def1

    abc1 geh1

    abc1 ijk1

    -- --

    table 1 has this format and i want to insert the records in table 2 in that

    format...pls give me the sample so that i can solve that problem.....

Viewing 14 posts - 1 through 13 (of 13 total)

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