The EnumUsers method returns a QueryResults object enumerating the users defined in a Microsoft® SQL Server™ database and their role participation.
object.EnumUsers( [ UserName ] ) as QueryResults
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list. |
UserName | Optional. String specifying a database user or role by name. When specified, directs content and membership of the returned result set. |
When UserName is not specified, or specifies a database user by name, the EnumUsers method returns a QueryResults object containing one result set defined by these columns.
Column | Data type | Description |
---|---|---|
UserName | nvarchar(29) | Database username. |
GroupName | nvarchar(33) | Database role. One row is returned for each role of which the user is a member. |
LoginName | nvarchar(45) | Login name. |
DefDBName | nvarchar(13) | Database used by default when a connection is made using the listed login. |
UserID | char(14) | System-generated database user identifier. |
SUserID | char(16) | System-generated login identifier. |
When UserName specifies a database role by name, the EnumUsers method returns a QueryResults object containing one result set defined by these columns.
Column | Data type | Description |
---|---|---|
Group_name | nvarchar(26) | Name of the database role |
Group_id | smallint | System-generated role identifier |
Users_in_group | nvarchar(26) | Database username |
Userid | smallint | System-generated database user identifier |
HRESULT EnumUsers(
LPSQLDMOQUERYRESULTS* ppResults,
LPCOLESTR UserName = NULL);