次の方法で共有


StoredProcedure Object

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The StoredProcedure object exposes the attributes of a single Microsoft SQL Server user-defined or system stored procedure.

現在のオブジェクトを表す SQL-DMO オブジェクト モデル

Properties

AnsiNullsStatus Property

QuotedIdentifierStatus Property

CreateDate Property

Startup Property

ID Property

SystemObject Property

Name Property

Text Property

Owner Property (Database Objects)

Type Property (StoredProcedure)

Methods

Alter Method

ListPermissions Method

Deny Method (StoredProcedure)

ListUserPermissions Method

EnumDependencies Method

Remove Method (Objects)

EnumParameters Method

Revoke Method (StoredProcedure)

Grant Method (StoredProcedure, UserDefinedFunction)

Script Method

解説

SQL Server has facilities for creation and persistent storage of compiled Transact-SQL scripts. These stored procedures can be run by users with sufficient permissions. With the StoredProcedure object, you can:

  • Create a SQL Server stored procedure.
  • Change the Transact-SQL script of an existing SQL Server stored procedure.
  • Enable a SQL Server stored procedure to run on SQL Server startup.
  • Control access rights to an existing SQL Server stored procedure.
  • Delete an existing SQL Server stored procedure.
  • Generate a Transact-SQL script to re-create a SQL Server stored procedure.

The Name property of a StoredProcedure object uses the SQL Server data type sysname. The value of the Name property must be unique (named by owner) within a SQL Server database.

ms133986.note(ja-jp,SQL.90).gifメモ :
The StoredProcedure object is compatible with instances of SQL Server versions 7.0 and later. However, the StoredProcedure2 object extends the functionality of the StoredProcedure object for use with features that were introduced in SQL Server 2000.

To create a SQL Server stored procedure

  1. Create a StoredProcedure object.

  2. Set the Name property.

  3. Set the Text property to contain the Transact-SQL script you want. SQL Server stored procedures can contain input and output parameters and can return the results of one or more SELECT statements or a single long integer. For more information about valid Transact-SQL scripts for the Text property, see CREATE PROCEDURE (Transact-SQL).

  4. Set optional property values. For example, set the Startup property to TRUE to enable the stored procedure to run when the SQL Server starts.

  5. Add the StoredProcedure object to the StoredProcedures collection of a connected Database object.

参照

関連項目

StoredProcedure2 Object

ヘルプおよび情報

SQL Server 2005 の参考資料の入手