How to: Create and Manage Stored Procedures
You can create, edit, copy, and delete stored procedures in your database. A stored procedure is Visual FoxPro code that is stored in the database (.dbc) file and operates specifically on data in the database.
To create a stored procedure
Open the database in the Database Designer.
On the Database menu, click Edit Stored Procedures.
An editing window opens so you can write code for the stored procedure.
To create a stored procedure for a database in a project
Open the project in the Project Manager.
In the Project Manager, expand the Data node, the Databases node, and then the database node in which you want to add a stored procedure.
Click the Stored Procedures node and then New.
An editing window opens so you can write code for the stored procedure.
To create a stored procedure programmatically
- Use the MODIFY PROCEDURE command.
For more information, see MODIFY PROCEDURE Command.
To edit a stored procedure
Perform one of the following:
- To edit a stored procedure from the Database Designer, on the Database menu, click Edit Stored Procedures.
-OR-
To edit a stored procedure from the Project Manager, click the Stored Procedures node, and then Modify.
-OR-
Use the MODIFY PROCEDURE command.
An editing window opens so you can edit code for the stored procedure.
To copy and append stored procedures to a text file
- Use the COPY PROCEDURES and APPEND PROCEDURES commands.
For more information, see COPY PROCEDURES Command and APPEND PROCEDURES Command.
To delete a stored procedure
Open the editing window for the stored procedure.
In the editing window, select the code you want to delete.
Press the DELETE key.