다음을 통해 공유


ListDatabasePermissions Method

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 않도록 하고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The ListDatabasePermissions method returns a SQLObjectList object that enumerates database maintenance privilege for one or more Microsoft SQL Server security accounts.

구문

object
.ListDatabasePermissions( [ Privilege ] )asSQLObjectList

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • Privilege
    Optional. Constrains the list to members that enumerates database maintenance statement permissions as described in Settings.

Prototype (C/C++)

HRESULT ListDatabasePermissions(
LPSQLDMOPERMISSIONLIST* ppList,
SQLDMO_PRIVILEGE_TYPE lPrivilegeTypes = SQLDMOPriv_AllDatabasePrivs);

Settings

When setting the Privilege argument to override default behavior, indicate more than a single statement execution permission by combining values using an OR logical operator. Set Privilege by using these SQLDMO_PRIVILEGE_TYPE values.

Constant

Value

Description

SQLDMOPriv_AllDatabasePrivs

130944

Default. List object enumerates all database maintenance statement execution permissions.

SQLDMOPriv_CreateDatabase

256

List object enumerates accounts granted permission to execute the CREATE DATABASE statement.

SQLDMOPriv_CreateDefault

4096

List object enumerates accounts granted permission to execute the CREATE DEFAULT statement.

SQLDMOPriv_CreateFunction

65366

List object enumerates accounts granted permission to execute the CREATE FUNCTION statement.

SQLDMOPriv_CreateProcedure

1024

List object enumerates accounts granted permission to execute the CREATE PROCEDURE statement.

SQLDMOPriv_CreateRule

16384

List object enumerates accounts granted permission to execute the CREATE RULE statement.

SQLDMOPriv_CreateTable

128

List object enumerates accounts granted permission to execute the CREATE TABLE statement.

SQLDMOPriv_CreateView

512

List object enumerates accounts granted permission to execute the CREATE VIEW statement.

SQLDMOPriv_DumpDatabase

2048

List object enumerates accounts with privilege required to backup a database.

SQLDMOPriv_DumpTransaction

8192

List object enumerates accounts with privilege required to backup a database transaction log.

Returns

A SQLObjectList object that contains 0 or more Permission objects.

주의

The ListDatabasePermissions method enumerates statement execution permission explicitly granted, and is maintained for compatibility with previous versions of SQL Server.

SQL Server server and database roles assign privilege by implicitly granting statement execution permissions. Implicit grants are not enumerated by the ListDatabasePermissions method.

For example, a user may be a member of the db_backupoperator role. The user has permission to execute a Transact-SQL BACKUP statement targeting either the database or its transaction log. The user will not be enumerated by the ListDatabasePermissions method as the grant is implicit in the role.