DROP CONSTRAINT Usage Notes - 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

Restrictions on Dropping a Row-Level Security Constraint

Before you can drop a row-level security constraint, you must remove the constraint from all objects that reference the constraint.

You can use the following example SQL requests to determine which database objects have constraint assignments.

Finding Tables and Indexes with a Security Constraint

  1. Query the DBC.Dependency table to find tables that have a security constraint column:

    SELECT database1name, object1name from dbc.dependency where object2name='constraint_name ';

  2. Run the SHOW TABLE command for each table returned by the query in step 1. The system displays the standard CREATE TABLE for the table, including any indexes that are defined on the table.

Determining Whether a Column is a Security Constraint

You can execute a HELP COLUMN statement against a column to find out whether the column is a security constraint. See HELP COLUMN.

Finding Views that Include a Security Constraint

SELECT databasename, tvmname from dbc.tvm, dbc.dbase
where
tablekind='V' and
tvm.databaseid=dbase.databaseid and
tvmid in (select tableid from dbc.tvfields where constraintid in
(select constraintid from dbc.secconstraints where constraintname='constraint_name'));

Finding Users or Profiles with an Assigned Constraint

For users:

SELECT UserName from DBC.UsrAsgdSecConstraintsV
where
ConstraintName='constraint_name'

For profiles:

SELECT ProfileName from DBC.ProfileAsgdSecConstraintsV
where
ConstraintName='constraint_name'