SET QUERY_BAND SQL Statement | Teradata Database - SET QUERY_BAND - Teradata Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Database
Release Number
20.00
Publication Date
June 2025
Content Type
SQL Reference
Publication ID
B035-1144-200K
ft:locale
en-US
ft:lastEdition
2026-09-23
dita:mapPath
mbm1747160743883.ditamap
dita:ditavalPath
jlp1749501702948.ditaval
ft:sourceId
dita
dita:id
mdr1472255012272
lifecycle
latest

Sets or removes a query band for the current session or transaction.

Middle-tier applications, through which end users access the Teradata system, can be programmed to use the SET QUERY_BAND statement to attach metadata to end user SQL queries.

You can also use query band names to do the following:
  • Track activity using Viewpoint
  • Filter requests for execution in addition to their use for Teradata Active System Management
  • Set the binpacking algorithm to use when reading Parquet files

The system logs query bands in DBQL, providing opportunities for subsequent analysis of queries.

ANSI Compliance

This statement is a Teradata extension to the ANSI SQL:2011 standard.

Required Privileges

IF you … THEN you must be granted this privilege on your trusted user name …
do not have a need to submit SET QUERY_BAND requests to set a Proxy User none.
need to submit SET QUERY_BAND requests to set a proxy user GRANT CONNECT THROUGH to a proxy user. See SQL Data Control Language, B035-1149.
must SET QUERY_BAND TVSTEMPERATURE = VERYHOT EXECUTE on DBC.VHCTRL.