Revoke Method (StoredProcedure)
This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
The Revoke method undoes a grant or deny of a stored procedure permission for one or more Microsoft SQL Server users or roles.
Set Privilege by using these SQLDMO_PRIVILEGE_TYPE values. To specify more than a single permission, combine values by using an OR logical operator.
Constant | Value | Description |
|---|---|---|
SQLDMOPriv_AllObjectPrivs | 63 | Revoke all granted or denied permissions on the referenced stored procedure. |
SQLDMOPriv_Execute | 16 | Revoke granted or denied execute permission on the referenced stored procedure. |
When a user is a member of more than a single role, the user can have permission to grant access to a stored procedure under one role and not under another. In this case, SQL Server security mechanisms prevent execution of the Revoke method on the StoredProcedure object referencing that stored procedure. Use the AsRole argument to specify the role under which permission to execute the grant exists.
Granting permissions to database users and roles by using the Revoke method of the StoredProcedure object requires appropriate permission. The SQL Server login used for SQLServer object connection must be granted the ability to execute GRANT referencing the stored procedure, the owner of the stored procedure, or a member of a role with greater privilege.
For more information about setting multistring parameters, see Using SQL-DMO Multistrings.
