The PrivilegeType property returns the access right granted to an authorized user or role on a specific database or database object.
object.PrivilegeType
| Part | Description |
|---|---|
| object | Expression that evaluates to an object in the Applies To list |
The PrivilegeType property is interpreted using this information.
| Constant | Value | Description |
|---|---|---|
| SQLDMOPriv_AllDatabasePrivs | 65408 | All database privileges |
| SQLDMOPriv_AllObjectPrivs | 63 | All applicable object privileges |
| SQLDMOPriv_CreateDatabase | 256 | Can create and own databases |
| SQLDMOPriv_CreateDefault | 4096 | Can create DEFAULT objects |
| SQLDMOPriv_CreateProcedure | 1024 | Can create and own stored procedure objects |
| SQLDMOPriv_CreateRule | 16384 | Can create rule objects |
| SQLDMOPriv_CreateTable | 128 | Can create and own base tables |
| SQLDMOPriv_CreateView | 512 | Can create and own view tables |
| SQLDMOPriv_Delete | 8 | Can delete rows in a referenced table |
| SQLDMOPriv_DumpDatabase | 2048 | Can back up a database |
| SQLDMOPriv_DumpTransaction | 8192 | Can back up a database transaction log |
| SQLDMOPriv_Execute | 16 | Can execute a referenced stored procedure |
| SQLDMOPriv_Insert | 2 | Can add rows to a referenced table |
| SQLDMOPriv_References | 32 | Can grant DRI on a referenced table |
| SQLDMOPriv_Select | 1 | Can query a referenced table |
| SQLDMOPriv_Unknown | 0 | No privilege assigned or unable to determine privilege on the referenced database or database object |
| SQLDMOPriv_Update | 4 | Can change row data in a referenced table |
A Permission object uniquely identifies a Microsoft® SQL Server™ database user or role granted a specific access right for a specific database or database object. For any given permission object retrieved using a privilege listing method, the PrivilegeType property will report a single, unpacked value.
For example, if a user has SELECT and INSERT access rights on a table, and the ListPermissions method of a Table object referencing that table is called, then two Permission objects are returned in the list. For one Permission object, the PrivilegeType property returns SQLDMOPriv_Select. For the other, PrivilegeType returns SQLDMOPriv_Insert.
Long, enumerated
Read-only
HRESULT GetPrivilegeType(SQLDMO_PRIVILEGE_TYPE* pRetVal);