How To Create, Edit, and Execute Stored Procedures in Visual InterDev (301072)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 2000 64 bit (all editions)
  • Microsoft SQL Server 7.0
  • Microsoft Visual InterDev 6.0

This article was previously published under Q301072

SUMMARY

This article shows how to create, edit, and execute stored procedures in SQL Server by using Visual InterDev 6.0.

Note that you can use the DataView window in Visual InterDev if you do not have SQL Server Enterprise Manager to edit your stored procedures.

back to the top

Requirements

    • Visual InterDev 6.0 Enterprise Edition
    • SQL Server 7 or later
back to the top

Create a New Project in Visual InterDev

  1. From the Visual InterDev File menu, click Project.
  2. In the Project Explorer window, right-click the Global.asa file, and then click Add data connection.
  3. In the Data Link Properties dialog box, enter connection information for your SQL Server server, and then click Test connection.
  4. From the View menu, click Other Windows and then click Data View.
  5. In the Data View window, expand the database, and then expand Stored Procedures.
back to the top

Add a New Stored Procedure

  1. In the Data View window, right-click Stored Procedures and then click New stored procedure from the context menu.
  2. Create a Stored Procedure by using the template provided in the window.NOTE: You can instead use Query Builder to build the SQL statement for a stored procedure by right-clicking in the window and selecting Insert SQL.

    • To add tables to Query Builder, drag tables from the DataView window to the top pane of the Query Builder window.
    • To test the stored procedures in the query builder window, from the Query menu, click Run.
  3. From the File menu, click Save <stored procedure name>.
back to the top

Edit a Stored Procedure

  1. Expand Stored Procedures in the Data View window.
  2. Right-click the stored procedure that you want to edit, and then click Open from the context menu. Make the necessary changes.

    NOTE: You can instead invoke the Query Builder to edit a stored procedure by selecting the query under Stored procedures in the Data View window and then clicking Edit SQL.
  3. From the File menu, click Save <stored procedure name>.
back to the top

Execute a Stored Procedure

  1. Expand Stored procedures in the Data View window.
  2. Right-click a stored procedure, and then click Execute from the context menu.

    If the stored procedure requires input parameters, enter them into the Execute dialog box that appears. The results of the stored procedure will be displayed in the Output window.
NOTE: You can instead use the Query Builder window to execute the stored procedure. To do so, open the Query Builder and then from the Query menu, click Run.

back to the top

Modification Type:MinorLast Reviewed:7/15/2004
Keywords:kbHOWTOmaster KB301072 kbAudDeveloper