Working with Parameters

Some stored procedures have no interface. They are called, but they do not receive or return anything. Other procedures are input only. These stored procedures have INPUT parameters but no OUTPUT parameters. A third type of stored procedure has both input parameters and OUTPUT parameters.

Input Parameters

Here is an example of a stored procedure that has neither INPUT nor OUTPUT parameters:

CREATE PROCEDURE procGetCustomersUSAOwners
AS
SELECT CompanyName, ContactName, ContactTitle, City
FROM Customers
WHERE Country = 'USA' AND
ContactTitle = 'Owner'
ORDER BY City, CompanyName

Contrast that stored procedure with the following:

 CREATE PROCEDURE procGetCustomersByCountryAndTitle @CountryName VarChar(50), @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.