Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Listing of current constraints in a database?
Mon, Mar 9 2020 10:17 PMPermanent Link

Ian Branch

Avatar

Hi Team,
How do I get a listing of all the current constraints in a database please?
I know there is are Constraints and a ConstraintColumns tables.
Regards & TIA,
Ian
Tue, Mar 10 2020 2:54 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


You've already (almost) spotted the answer

select * from information.constraints

or

select * from information.constraintcolumns


replace * with the columns you want

The tables in the information database can be queried just like any other table so you can ORDER BY, GROUP BY etc to get what you want. Check out the OLH for Information Schema (and Configuration Database for more useful tables)

Roy Lambert
Tue, Mar 10 2020 4:52 AMPermanent Link

Ian Branch

Avatar

Thanks Roy.
All good.
Regards,
Ian
Image