• VC6 SQL Debugging Example: 不及格的程序员


    SQL Debugging Example: “Hello, World”

    Feature Only in Enterprise Edition   SQL source code debugging is supported only in Visual C++ Enterprise Edition. For more information, see .

    This example assumes the following:

    • SQL Server 6.5 is installed.

    • VC++ Enterprise Edition is installed with the SQL Server Debugging options.

    • You have added SQL Server to your ODBC data sources using the ODBC application’s ODBC SQL Server Setup dialog box.

    To create the SQL Debugging example “Hello World”

    1. Start VC++ Enterprise Edition.

    2. Start the SQL Server.

    3. From the File menu, click New.

    4. Select the Projects tab.

    5. Choose a Database Project.

    6. Type the Project Name “HelloWorld”.

    7. Click Create new workspace.

    8. Click OK.

      The SQL Data Source dialog appears.

    9. Choose a data source that is a debugging-enabled SQL Server database.

      For example, if you have a default SQL Server setup on your local workstation, you can use the “pubs” database by clicking the Machine Data Source tab and selecting “pubs”.

    10. Click OK.

    11. At the SQL Server Login dialog box, enter a valid Login ID and Password.

      You can click Options to change to any of the available databases. If you have a default setup, for the “pubs” database you can use Login Id “sa” and leave the Password blank.

    12. Click OK.

    13. Select the database.

      In the Data View pane of the project workspace, expand the project and select the database. For example, select “pubs(servername)” where “servername” is the name of your SQL Server.

    14. From the Insert menu, click New Database Item.

      The Insert Database Item dialog appears.

    15. In the Database Item listbox, select Stored Procedure.

    16. Click OK.

      The prototype for the HelloWorld stored procedure appears in the SQL editor.

    17. Edit the HelloWorld stored procedure so it looks as follows:

      CREATE PROCEDURE HelloWorld AS
      PRINT 'Hello, world!'
      RETURN (0)
      
    18. From the File menu, click Save.

      The stored procedure named “HelloWorld” is saved in the Stored Procedures folder associated with the database.

    19. Right-click in the HelloWorld editor window and click Debug.

    20. Automation manager will start.

    21. When the yellow arrow appears (the instruction pointer), you're debugging your stored procedure. Press F5 to finish executing it.

    22. In the Results tab of the Output window, you'll see "Hello, world" displayed. You may need to scroll the window to see it.

      You have successfully debugged your first SQL stored procedure.

  • 相关阅读:
    汉语-词语:架构(计算机术语)
    汉语-词语:架构
    全世界云计算宕机和中断[2013年-2014年集锦]
    java异常处理Exception
    CodeForces 390E Inna and Large Sweet Matrix(树状数组改段求段)
    操作系统CPU调度知识点
    hp-ux 集群,内存 小记
    增强for循环、Map接口遍历、可变參数方法
    spring下载和安装
    Android设计模式(八)--模板方法模式
  • 原文地址:https://www.cnblogs.com/ioriwellings/p/15917596.html
Copyright © 2020-2023  润新知