StoredProcedure Object (SQL-DMO)

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

Remarks

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

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.

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.
  4. Set optional property values. For example, set the Startup property to True to enable the stored procedure for execution when the SQL Server starts.
  5. Add the StoredProcedure object to the StoredProcedures collection of a connected Database object.
Methods
Alter Method ListPermissions Method
Deny Method (StoredProcedure) ListUserPermissions Method
EnumDependencies Method Remove Method (Objects)
EnumParameters Method Revoke Method (StoredProcedure)
Grant Method (StoredProcedure) Script Method

Properties
AnsiNullsStatus Property QuotedIdentifierStatus Property
CreateDate Property Startup Property
ID Property SystemObject Property
Name Property Text Property
Owner Property (Database Objects) Type Property (StoredProcedure)

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.