共用方式為


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
)
as
SQLObjectList

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.

Applies To:

DBObject Object

UserDefinedFunction Object

StoredProcedure Object

View Object

Table Object