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.

建立預存程序。

附註: Microsoft Access 資料庫引擎不支援搭配非 Microsoft Access 資料庫引擎資料庫使用 CREATE PROCEDURE 或任何 DDL 陳述式。

語法

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

CREATE PROCEDURE 陳述式由下列各部分組成:

部分

描述

procedure

程序名稱。

param1param2

從 1 到 255 個欄位名稱或參數。

datatype

其中一個主要 Microsoft Access SQL 資料類型或其同義字。

sqlstatement

一個 SQL 陳述式,例如 SELECT、UPDATE、DELETE、INSERT、CREATE TABLE、DROP TABLE 等等。


範例

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]

備註

SQL 程序由一個指定程序名稱的 PROCEDURE 子句、一份選擇性的參數定義清單,以及一個單一的 SQL 陳述式所組成。

程序名稱不能和現有資料表的名稱相同。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
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!

×