Tuesday 15 August 2017

Get the list of Constraint in a database in sql server

With the help of below script we will get the list of constraint in a database.
SELECT CONSTRAINT_NAME,
                CONSTRAINT_CATALOG as Database_Name,
                 TABLE_SCHEMA ,
     TABLE_NAME,
     CONSTRAINT_TYPE
     FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
See the output.


No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts