Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Creates a stored procedure.

Note: The Microsoft Access database engine does not support the use of CREATE PROCEDURE, or any of the DDL statements, with non-Microsoft Access database engine databases.

Syntax

CREATE PROCEDURE procedure (param1 datatype[, param2 datatype][, ...]) AS sqlstatement

The CREATE PROCEDURE statement has these parts:

Part

Description

procedure

A name for the procedure.

param1, param2

From one to 255 field names or parameters.

datatype

One of the primary Microsoft Access SQL Data Types or their synonyms.

sqlstatement

An SQL statement such as SELECT, UPDATE, DELETE, INSERT, CREATE TABLE, DROP TABLE, and so on.


Example

CREATE PROCEDURE Sales_By_CountryRegion ([Beginning Date] DateTime, [Ending Date] DateTime) AS SELECT Customer, [Ship Address] WHERE [Shipped Date] Between [Beginning Date] And [Ending Date]

Remarks

An SQL procedure consists of a PROCEDURE clause that specifies the name of the procedure, an optional list of parameter definitions, and a single SQL statement.

A procedure name cannot be the same as the name of an existing table.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×