SET ROLE SQL Statement | Teradata Vantage - SET ROLE - Teradata Vantage - Analytics Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-22
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantageā„¢

Sets the current role for a session. It does not distinguish between directory- and database-managed roles.

You cannot use SET ROLE in a procedure definition.

SET ROLE ALL enables all roles granted to the user submitting the SET ROLE statement, including nested roles.

Use of SET ROLE EXTERNAL requires that the user is a directory user and is mapped to the external role object in the directory. For details, see Teradata Vantageā„¢ - Analytics Database Security Administration, B035-1100.

The use of SET ROLE is not permitted in a trusted session. The active roles for trusted sessions must be defined using the SET QUERY_BAND request. See SET QUERY_BAND.

ANSI Compliance

SET ROLE is ANSI SQL:2011-compliant, except for the NULL, EXTERNAL, and ALL options, which are Teradata extensions.

Required Privileges

Statement Result
SET ROLE NONE

SET ROLE NULL

No privilege is needed to disable the current role for a session.
SET ROLE role_name The role must already be granted to you.
SET ROLE ALL No privilege is needed and you are not required to have any roles granted to you.
SET ROLE EXTERNAL At least one role must already be assigned (mapped) to you in the directory. See Security Administration.