ListObjectPermissions Method
Questa caratteristica verrà rimossa a partire da una delle prossime versioni di Microsoft SQL Server. Evitare di utilizzare questa caratteristica in un nuovo progetto di sviluppo e prevedere interventi di modifica nelle applicazioni in cui è attualmente implementata.
The ListObjectPermissions method returns a SQLObjectList object that enumerates object access privilege for one or more Microsoft SQL Server security accounts.
Sintassi
object
.ListObjectPermissions( [ Privilege ] )as SQLObjectList
Parts
object
Expression that evaluates to an object in the Applies To list.Privilege
Optional. Constrains the list to members that enumerates object access permissions as described in Settings.
Prototype (C/C++)
HRESULT ListObjectPermissions(
LPSQLDMOPERMISSIONLIST* ppList,
SQLDMO_PRIVILEGE_TYPE lPrivilegeTypes = SQLDMOPriv_AllObjectPrivs);
Settings
When setting the Privilege argument to override default behavior, indicate more than a single permission by combining values using an OR logical operator. Set Privilege by using these SQLDMO_PRIVILEGE_TYPE values.
Constant |
Value |
Description |
---|---|---|
SQLDMOPriv_/AllObjectPrivs |
63 |
Default. All applicable object privilege. |
SQLDMOPriv_Delete |
8 |
List object enumerates accounts and those tables or views against which permission is granted to execute a DELETE statement. |
SQLDMOPriv_Execute |
16 |
List object enumerates accounts and those stored procedures for which permission is granted to execute an EXECUTE statement. |
SQLDMOPriv_Insert |
2 |
List object enumerates accounts and those tables or views against which permission is granted to execute an INSERT statement. |
SQLDMOPriv_References |
32 |
List object enumerates accounts, and those tables that the account can reference, in declarative referential integrity constraints. |
SQLDMOPriv_Select |
1 |
List object enumerates accounts and those tables or views against which permission is granted to execute a SELECT statement. |
SQLDMOPriv_Update |
4 |
List object enumerates accounts and those tables or views against which permission is granted to execute an UPDATE statement. |
Returns
A SQLObjectList object that contains 0 or more Permission objects
Osservazioni
The ListObjectPermissions method enumerates object access permissions granted explicitly.
SQL Server server and database roles assign privilege by granting statement execution permissions implicitly. Implicit grants are not enumerated by the ListObjectPermissions method.