EnumUsers Method

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新しい開発作業では、この機能の使用を避け、現在この機能を使用しているアプリケーションは修正するようにしてください。

The EnumUsers method returns a QueryResults object that enumerates the users defined in a Microsoft SQL Server database and their role participation.

構文

object.EnumUsers( [ UserName ] )as QueryResults

Parts

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

  • UserName
    Optional. String that specifies a database user or role by name. When specified, directs content and membership of the returned result set.

Prototype (C/C++)

HRESULT EnumUsers(
LPSQLDMOQUERYRESULTS* ppResults,
LPCOLESTR UserName = NULL);

Returns

When UserName is not specified, or specifies a database user by name, the EnumUsers method returns a QueryResults object that contains one result set defined by these columns.

Column

Data type

Description

DefDBName

nvarchar(13)

Database used by default when a connection is made using the listed login.

GroupName

nvarchar(17)

Database role. One row is returned for each role of which the user is a member.

LoginName

nvarchar(5)

Login name.

SID

varbinary(91)

System-generated login account.

UserID

char(14)

System-generated database user identifier.

UserName

nvarchar(11)

Database username.

When UserName specifies a database role by name, the EnumUsers method returns a QueryResults object that contains one result set defined by these columns.

Column

Data type

Description

Group_id

smallint

System-generated role identifier.

Group_name

nvarchar(26)

Name of the database role.

Userid

smallint

System-generated database user identifier.

Users_in_group

nvarchar(26)

Database username.

Applies To: