{"id":376,"date":"2012-01-13T07:49:16","date_gmt":"2012-01-13T05:49:16","guid":{"rendered":"http:\/\/www.extradrm.com\/?p=376"},"modified":"2013-06-18T20:55:20","modified_gmt":"2013-06-18T18:55:20","slug":"how-to-list-all-check-constraints-in-the-database","status":"publish","type":"post","link":"http:\/\/www.extradrm.com\/?p=376","title":{"rendered":"How to list constraints in an sql server database?"},"content":{"rendered":"<p><span style=\"color: #0000ff; font-family: verdana; font-size: xx-small;\">Execute the following Microsoft T-SQL example scripts in SQL Server Management Studio Query Editor to list all or specific CHECK constraints in AdventureWorks database.<\/span><br \/>\n&#8212;&#8212;&#8212;&#8212;<br \/>\n&#8212; Microsoft SQL Server T-SQL list all check constraints in database<br \/>\n&#8212;&#8212;&#8212;&#8212;<br \/>\n&#8212; MSSQL information_schema views<br \/>\nUSE AdventureWorks;<br \/>\nSELECT\u00a0\u00a0 TABLE_NAME,<br \/>\nCOLUMN_NAME,<br \/>\nCHECK_CLAUSE,<br \/>\ncc.CONSTRAINT_SCHEMA,<br \/>\ncc.CONSTRAINT_NAME<br \/>\nFROM\u00a0\u00a0\u00a0\u00a0 INFORMATION_SCHEMA.CHECK_CONSTRAINTS cc<br \/>\nINNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE c<br \/>\nON cc.CONSTRAINT_NAME = c.CONSTRAINT_NAME<br \/>\nORDER BY CONSTRAINT_SCHEMA,<br \/>\nTABLE_NAME,<br \/>\nCOLUMN_NAME<br \/>\nGO<br \/>\n\/* Partial results<\/p>\n<table cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col width=\"151\" \/>\n<col width=\"118\" \/>\n<col width=\"364\" \/> <\/colgroup>\n<tbody>\n<tr>\n<td width=\"151\" height=\"20\">TABLE_NAME<\/td>\n<td width=\"118\">COLUMN_NAME<\/td>\n<td width=\"364\">CHECK_CLAUSE<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesOrderHeader<\/td>\n<td>OrderDate<\/td>\n<td>([DueDate]&gt;=[OrderDate])<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesOrderHeader<\/td>\n<td>OrderDate<\/td>\n<td>([ShipDate]&gt;=[OrderDate] OR [ShipDate] IS NULL)<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesOrderHeader<\/td>\n<td>ShipDate<\/td>\n<td>([ShipDate]&gt;=[OrderDate] OR [ShipDate] IS NULL)<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesOrderHeader<\/td>\n<td>Status<\/td>\n<td>([Status]&gt;=(0) AND [Status]&lt;=(8))<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesOrderHeader<\/td>\n<td>SubTotal<\/td>\n<td>([SubTotal]&gt;=(0.00))<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesOrderHeader<\/td>\n<td>TaxAmt<\/td>\n<td>([TaxAmt]&gt;=(0.00))<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesPerson<\/td>\n<td>Bonus<\/td>\n<td>([Bonus]&gt;=(0.00))<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesPerson<\/td>\n<td>CommissionPct<\/td>\n<td>([CommissionPct]&gt;=(0.00))<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesPerson<\/td>\n<td>SalesLastYear<\/td>\n<td>([SalesLastYear]&gt;=(0.00))<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesPerson<\/td>\n<td>SalesQuota<\/td>\n<td>([SalesQuota]&gt;(0.00))<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">SalesPerson<\/td>\n<td>SalesYTD<\/td>\n<td>([SalesYTD]&gt;=(0.00))<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>*\/<\/p>\n<p>&#8212; SQL CHECK constraints: table name wildcard search<br \/>\nSELECT\u00a0\u00a0 TABLE_NAME,<br \/>\nCOLUMN_NAME,<br \/>\nCHECK_CLAUSE,<br \/>\ncc.CONSTRAINT_SCHEMA,<br \/>\ncc.CONSTRAINT_NAME<br \/>\nFROM\u00a0\u00a0\u00a0\u00a0 INFORMATION_SCHEMA.CHECK_CONSTRAINTS cc<br \/>\nINNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE c<br \/>\nON cc.CONSTRAINT_NAME = c.CONSTRAINT_NAME<br \/>\nWHERE\u00a0\u00a0\u00a0 TABLE_NAME LIKE &#8216;%CONTACT%&#8217;<br \/>\nORDER BY CONSTRAINT_SCHEMA,<br \/>\nTABLE_NAME,<br \/>\nCOLUMN_NAME<br \/>\nGO<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<h2>How to list all constraints by table?<\/h2>\n<p>Execute the following Microsoft SQL Server T-SQL script to list all constraint in the database by schema, by table, by column:<\/p>\n<p>use AdventureWorks;<\/p>\n<p>select<\/p>\n<p>c.TABLE_SCHEMA,<\/p>\n<p>c.TABLE_NAME,<\/p>\n<p>c.COLUMN_NAME,<\/p>\n<p>c.CONSTRAINT_NAME<\/p>\n<p>from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE as c<\/p>\n<p>union all<\/p>\n<p>select<\/p>\n<p>s.name,<\/p>\n<p>o.name,<\/p>\n<p>c.name,<\/p>\n<p>dc.name<\/p>\n<p>from sys.default_constraints as dc<\/p>\n<p>join sys.objects as o<\/p>\n<p>on o.object_id = dc.parent_object_id<\/p>\n<p>join sys.columns as c<\/p>\n<p>on c.object_id = o.object_id<\/p>\n<p>and c.column_id = dc.parent_column_id<\/p>\n<p>join sys.schemas as s<\/p>\n<p>on s.schema_id = o.schema_id<\/p>\n<p>order by TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME<\/p>\n<h2>SQL Server TSQL to find detailed CONSTRAINTS information<\/h2>\n<p><span style=\"font-family: trebuchet ms,geneva;\">TO enforce the integrity of the data in the columns, CONSTRAINTS are very useful. <\/span><\/p>\n<p><span style=\"font-family: trebuchet ms,geneva;\">In this regard SQL Server provides various mechanims in enforcing such integrity:<\/span><\/p>\n<div>\n<ul>\n<li><span style=\"font-family: trebuchet ms,geneva;\">PRIMARY KEY Constraints <\/span><\/li>\n<li><span style=\"font-family: trebuchet ms,geneva;\">FOREIGN KEY Constraints <\/span><\/li>\n<li><span style=\"font-family: trebuchet ms,geneva;\">UNIQUE Constraints <\/span><\/li>\n<li><span style=\"font-family: trebuchet ms,geneva;\">CHECK Constraints <\/span><\/li>\n<li><span style=\"font-family: trebuchet ms,geneva;\">DEFAULT Definitions<\/span><\/li>\n<li><span style=\"font-family: trebuchet ms,geneva;\">Allowing Null Values <\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: trebuchet ms,geneva;\">Further steps are required in the database design to identify valid values for a column and to decide how to enforce the integrity of the data in the column. Data integrity falls into the following categories:\u00a0 Entity integrity\/Domain integrity\/Referential integrity\/User-defined integrity. Among these Referential integrity is commonly used which preserves the defined relationships between tables when rows are entered or deleted. In SQL Server, referential integrity is based on relationships between foreign keys and primary keys or between foreign keys and unique keys, through FOREIGN KEY and CHECK constraints. Referential integrity makes sure that key values are consistent across tables.<\/span><\/p>\n<p><span style=\"font-family: trebuchet ms,geneva;\">Here is the script which can used to obtain a detailed information on CONSTRAINTS in your database:<\/span><\/p>\n<p><span style=\"color: #0000ff; font-size: x-small;\"><span style=\"color: #0000ff; font-size: x-small;\"><span style=\"font-family: courier new,courier; font-size: small;\">SELECT<\/span><\/span><\/span><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"> KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>table_name<span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\">KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>column_name field_name<span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\">TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_type<span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">CASE<\/span><\/span> TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>is_deferrable <span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">WHEN<\/span><\/span> <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;NO&#8217;<\/span><\/span> <span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">THEN<\/span><\/span> 0 <span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">ELSE<\/span><\/span> 1 <span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">END<\/span><\/span> <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;is_deferrable&#8217;<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">CASE<\/span><\/span> TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>initially_deferred <span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">WHEN<\/span><\/span> <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;NO&#8217;<\/span><\/span> <span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">THEN<\/span><\/span> 0 <span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">ELSE<\/span><\/span> 1 <span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">END<\/span><\/span> <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;is_deferred&#8217;<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\">rc<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>match_option <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;match_type&#8217;<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\">rc<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>update_rule <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;on_update&#8217;<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\">rc<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>delete_rule <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;on_delete&#8217;<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\">ccu<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>table_name <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;references_table&#8217;<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\">ccu<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>column_name <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;references_field&#8217;<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\">KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>ordinal_position <span style=\"color: #ff0000;\"><span style=\"color: #ff0000;\">&#8216;field_position&#8217;<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">FROM<\/span><\/span> <span style=\"color: #008000;\"><span style=\"color: #008000;\">INFORMATION_SCHEMA<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span><span style=\"color: #008000;\"><span style=\"color: #008000;\">KEY_COLUMN_USAGE<\/span><\/span> KCU<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #808080;\"><span style=\"color: #808080;\">LEFT<\/span><\/span> <span style=\"color: #808080;\"><span style=\"color: #808080;\">JOIN<\/span><\/span> <span style=\"color: #008000;\"><span style=\"color: #008000;\">INFORMATION_SCHEMA<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span><span style=\"color: #008000;\"><span style=\"color: #008000;\">TABLE_CONSTRAINTS<\/span><\/span> TC<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">ON<\/span><\/span> KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>table_name <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span>TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>table_name<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #808080;\"><span style=\"color: #808080;\">AND<\/span><\/span> KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>table_schema <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span>TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>table_schema<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #808080;\"><span style=\"color: #808080;\">AND<\/span><\/span> KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>table_catalog <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span>TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>table_catalog<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #808080;\"><span style=\"color: #808080;\">AND<\/span><\/span> KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_catalog <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span>TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_catalog<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #808080;\"><span style=\"color: #808080;\">AND<\/span><\/span> KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_name <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span>TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_name<\/span><\/span><\/p>\n<p><span style=\"color: #808080;\"><span style=\"color: #808080;\"><span style=\"font-family: courier new,courier; font-size: small;\">LEFT<\/span><\/span><\/span><span style=\"font-family: courier new,courier; font-size: small;\"> <span style=\"color: #808080;\"><span style=\"color: #808080;\">JOIN<\/span><\/span> <span style=\"color: #008000;\"><span style=\"color: #008000;\">INFORMATION_SCHEMA<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span><span style=\"color: #008000;\"><span style=\"color: #008000;\">REFERENTIAL_CONSTRAINTS<\/span><\/span> rc<\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">ON<\/span><\/span> rc<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_schema <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span>TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_schema<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #808080;\"><span style=\"color: #808080;\">AND<\/span><\/span> rc<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_catalog <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span>TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_catalog<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #808080;\"><span style=\"color: #808080;\">AND<\/span><\/span> rc<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_name <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span>TC<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_name<\/span><\/span><\/p>\n<p><span style=\"color: #808080;\"><span style=\"color: #808080;\"><span style=\"font-family: courier new,courier; font-size: small;\">LEFT<\/span><\/span><\/span><span style=\"font-family: courier new,courier; font-size: small;\"> <span style=\"color: #808080;\"><span style=\"color: #808080;\">JOIN<\/span><\/span> <span style=\"color: #008000;\"><span style=\"color: #008000;\">INFORMATION_SCHEMA<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span><span style=\"color: #008000;\"><span style=\"color: #008000;\">CONSTRAINT_COLUMN_USAGE<\/span><\/span> ccu<\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">ON<\/span><\/span> rc<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>unique_constraint_schema <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span> ccu<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_schema<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #808080;\"><span style=\"color: #808080;\">AND<\/span><\/span> rc<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>unique_constraint_catalog <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span> ccu<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_catalog<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #808080;\"><span style=\"color: #808080;\">AND<\/span><\/span> rc<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>unique_constraint_name <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span> ccu<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_name<\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">WHERE<\/span><\/span> KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_catalog <span style=\"color: #808080;\"><span style=\"color: #808080;\">=<\/span><\/span> <span style=\"color: #ff00ff;\"><span style=\"color: #ff00ff;\">DB_NAME<\/span><\/span><span style=\"color: #808080;\"><span style=\"color: #808080;\">()<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-size: small;\"><span style=\"font-family: courier new,courier;\"><span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">ORDER<\/span><\/span> <span style=\"color: #0000ff;\"><span style=\"color: #0000ff;\">BY<\/span><\/span> KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>constraint_name<span style=\"color: #808080;\"><span style=\"color: #808080;\">,<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-family: courier new,courier; font-size: small;\">KCU<span style=\"color: #808080;\"><span style=\"color: #808080;\">.<\/span><\/span>ordinal_position<\/span><span style=\"color: #808080; font-size: x-small;\"><span style=\"color: #808080; font-size: x-small;\"><span style=\"font-family: courier new,courier; font-size: small;\">;<\/span><\/span><\/span><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Execute the following Microsoft T-SQL example scripts in SQL Server Management Studio Query Editor to list all or specific CHECK constraints in AdventureWorks database. &#8212;&#8212;&#8212;&#8212; &#8212; Microsoft SQL Server T-SQL list all check constraints&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2845,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[28,25],"tags":[47,104],"youtube_video":null,"_links":{"self":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/376"}],"collection":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=376"}],"version-history":[{"count":0,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/376\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/media\/2845"}],"wp:attachment":[{"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=376"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}