后续版本的 Microsoft SQL Server 将删除该功能。请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。
The Permissions property returns the database permissions for the current connection.
语法
object
.Permissions
Parts
- object
 An expression that evaluates to an object in the Applies To list
Data Type
Long, enumerated
Modifiable
Read-only
Prototype (C/C++)
HRESULT GetPermissions(SQLDMO_PRIVILEGE_TYPE* pRetVal);
Returns
The return value is a bit-packed long integer, interpreted using this information.
| Constant | Value | Description | 
|---|---|---|
| SQLDMOPriv_AllDatabasePrivs | 130944 | Has all database permissions. | 
| SQLDMOPriv_AllObjectPrivs | 63 | Has all applicable object permissions. | 
| SQLDMOPriv_CreateDatabase | 256 | Can create and own databases. | 
| SQLDMOPriv_CreateDefault | 4096 | Can create DEFAULT objects. | 
| SQLDMOPriv_CreateFunction | 65366 | Can create and own UserDefinedFunction objects. | 
| SQLDMOPriv_CreateProcedure | 1024 | Can create and own StoredProcedure objects. | 
| SQLDMOPriv_CreateRule | 16384 | Can create rules. | 
| 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_DumpTable | 32768 | Can back up a referenced table. | 
| 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 (declarative referential integrity) on a referenced table. | 
| SQLDMOPriv_Select | 1 | Can query a referenced table. | 
| SQLDMOPriv_Unknown | 0 | Has no permissions granted, or permissions could not be determined on the referenced database or database object. | 
| SQLDMOPriv_Update | 4 | Can change row data in a referenced table. | 
备注
Configure database permissions using the Grant, Revoke, and Deny methods.
Applies To:
请参阅
参考
Deny Method (Database)
Grant Method (Database)
Revoke Method (Database)