The Permissions property returns the database privileges for the current connection.
object.Permissions
| Part | Description |
|---|---|
| object | Expression that evaluates to an object in the Applies To list |
The return value is a bit-packed long integer, interpreted using this information.
| Constant | Value | Description |
|---|---|---|
| SQLDMOPriv_AllDatabasePrivs | 65408 | All database 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_DumpDatabase | 2048 | Can back up a database |
| SQLDMOPriv_DumpTransaction | 8192 | Can back up a database transaction log |
| SQLDMOPriv_Unknown | 0 | No privilege assigned or unable to determine privilege on the referenced database or database object |
Configure database permission by using the Grant, Revoke, and Deny methods.
Long, enumerated
Read-only
HRESULT GetPermissions(SQLDMO_PRIVILEGE_TYPE* pRetVal);
| Deny Method (Database) | Revoke Method (Database) |
| Grant Method (Database) |