SQL Server Performance

SQL Server TSQL to find complete CONSTRAINT information on a table catalog?

Discussion in 'Other SQL Server Blogs around the Web' started by Anonymous, Jan 9, 2008.

  1. Anonymous New Member

    I have had a requirement to see a detailed information about a constraint on a table that includes table fields, type, rules, referenced table and fields for FOREIGN KEYs, etc. Found this useful TSQL to get such information: SELECT k.table_name, k.column_name field_name, c.constraint_type, CASE c.is_deferrable WHEN 'NO' THEN 0 ELSE 1 END 'is_deferrable', CASE c.initially_deferred WHEN 'NO' THEN 0 ELSE 1 END 'is_deferred', rc.match_option 'match_type', rc.update_rule 'on_update', rc.delete_rule 'on_delete',...(<a href="http://sqlserver-qa.net/blogs/t-sql/archive/2008/01/09/2475.aspx">read more</a>)<img src="http://sqlserver-qa.net/aggbug.aspx?PostID=2475" width="1" height="1">

Share This Page