Updated on 2025-04-21 GMT+08:00

DROP CONSTRAINT

Function

This command deletes a CHECK constraint.

Syntax

ALTER TABLE [database_name.]table_name|DELTA.`obs://bucket_name/tbl_path`

DROP CONSTRAINT constraint_name

Parameter Description

Table 1 Parameter descriptions of DROP CONSTRAINT

Parameter

Description

database_name

Name of the database, consisting of letters, numbers, and underscores (_)

table_name

Name of the table in the database, consisting of letters, numbers, and underscores (_)

bucket_name

OBS bucket name

tbl_path

Storage location of the Delta table in the OBS bucket

constraint_name

Constraint name

Required Permissions

  • SQL permissions
Table 2 Permissions required for executing DROP CONSTRAINT

Permission Description

ALTER permission on a table

  • Fine-grained permission: dli:table:alter
  • Metadata services provided by LakeFormation. Refer to the LakeFormation documentation for details on permission configuration.

Example

alter table delta_table0 drop constraint const_price;

alter table delta.`obs://bucket1/dbgms/h0` drop constraint const_id;

System Response

Displays whether the task is successfully executed in the execution history or job list.