how to drop a constraint without knowing its name

Database
N/A

how to drop a constraint without knowing its name

Hi all,
today I wasn't able to drop a foreign key constraint because I didn't know its name.
Is there a way to get it from a data dictionary table/view?

thanks
2 REPLIES
Enthusiast

Re: how to drop a constraint without knowing its name

If you are still looking for solution, try below query. Hope this helps.

select
al1.*
from
dbc.ConstraintNames al1,
dbc.tables2 al2,
dbc.databases2 al3
where
al1.tableid = al2.tvmid
and al2.tvmname= ' '
and al2.databaseid = al3.databaseid
and al3.databasename = ' '
Enthusiast

Re: how to drop a constraint without knowing its name

Sorry, somehow my message did not come up as i sent. You should put tablename for tvmname column.