ListUserPermissions Method

后续版本的 Microsoft SQL Server 将删除该功能。 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。

The ListUserPermissions method returns a SQLObjectList object that enumerates object access privilege for a specified Microsoft SQL Server database role or user.

语法

object.ListUserPermissions(UserName)asSQLObjectList

Parts

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

  • UserName
    String that specifies an existing SQL Server user-defined database role or user by name.

Prototype (C/C++)

HRESULT ListUserPermissions(
SQLDMO_LPCSTR UserName,
LPSQLDMOPERMISSIONLIST* ppList);

Returns

A SQLObjectList object that contains 0 or more Permission objects.

注释

The ListUserPermissions 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 ListUserPermissions method.