Friday, 13 November 2020

Get all the constraints on a table

Below command is used to get all the constraints defined on a table.

 

SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_NAME='{TABLE_NAME}';

 

Example

SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_NAME='employee'; 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment