Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

sys.user_token (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Returns one row for every database principal that is part of the user token in SQL Server.

Applies to: SQL Server (SQL Server 2008 through current version).

Column name

Data type

Description

principal_id

int

ID of the principal. The value is unique within database.

sid

varbinary(85)

Security identifier of the principal if the principal is defined external to the database. For example, this can be a SQL Server login, Windows login, Windows Group login, or a login mapped to a certificate, otherwise, this value is NULL.

name

nvarchar (128)

Name of the principal. The value is unique within database.

type

nvarchar (128)

Description of principal type. All types are mapped to sid. The value can be one of the following:

  • SQL USER

  • WINDOWS LOGIN

  • WINDOWS GROUP

  • ROLE

  • APPLICATION ROLE

  • DATABASE ROLE

  • USER MAPPED TO CERTIFICATE

  • USER MAPPED TO ASYMMETRIC KEY

  • CERTIFICATE

  • ASYMMETRIC KEY

usage

nvarchar (128)

Indicates the principal participates in the evaluation of GRANT or DENY permissions, or serves as an authenticator.

This value can be one of the following:

  • GRANT OR DENY

  • DENY ONLY

  • AUTHENTICATOR

Community Additions

ADD
Show:
© 2015 Microsoft