Modifying Data with Stored Procedures

Probably the most common use of a stored procedure is to modify the data in your database. You can easily design stored procedures to insert, update, and delete data. The sections that follow cover stored procedures that perform each of these tasks.

Inserting Data

Stored procedures are very effective at inserting data into your databases. Stored procedures that insert data generally contain several input parameters, one that corresponds with each field in the underlying table. They often contain OUTPUT parameters containing status or error information. Take a look at the following stored procedure:

 CREATE PROCEDURE procAddCustomer @CustomerID char(5), @CompanyName varchar(40), @ContactName varchar(30), @ContactTitle ...

Get Alison Balter's Mastering Access 2002 Enterprise Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.