Deny Method (StoredProcedure)

Dieses Feature wird in einer zukünftigen Version von Microsoft SQL Server entfernt. Verwenden Sie dieses Feature beim Entwickeln neuer Anwendungen nicht, und planen Sie das Ändern von Anwendungen, in denen es zurzeit verwendet wird.

The Deny method negates a granted stored procedure permission or a list of granted permissions for one or more Microsoft SQL Server 2000 users or roles.

Syntax

object
.Deny(
Privilege
,
GranteeNames
, [ GrantGrant ] )

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • Privilege
    Long integer that specifies one or more stored procedure privileges as described in Settings.
  • GranteeNames
    SQL Distributed Management Objects (SQL-DMO) multistring that lists users or roles.
  • GrantGrant
    When TRUE, the grantee(s) specified are granted the ability to execute the DENY statement referencing the stored procedure. When FALSE (default), the ability to deny permission is not granted.

Prototype (C/C++)

HRESULT Deny(
SQLDMO_PRIVILEGE_TYPE iPrivileges,
SQLDMO_LPCSTR GranteeNames,
BOOL GrantGrant = FALSE);

Settings

Set Privilege by using these SQLDMO_PRIVILEGE_TYPE values.

Constant Value Description

SQLDMOPriv_AllObjectPrivs

63

Deny all granted permissions on the referenced stored procedure.

SQLDMOPriv_Execute

16

Deny EXECUTE permission on the referenced stored procedure.

Hinweise

Denying permission to database users and roles by using the Deny method of the StoredProcedure object requires appropriate permission. The SQL Server login used for SQLServer object connection must be granted the ability to execute DENY referencing the stored procedure, the owner of the stored procedure, or a member of a role with greater permission.

For more information about setting multistring parameters, see Using SQL-DMO Multistrings.

Applies To:

StoredProcedure Object