Here is the another TSQL script from BOL to find the CHECK constraints that depend on a specified CLR user-defined type? USE <database_name>; GO SELECT SCHEMA_NAME(o.schema_id) AS schema_name ,OBJECT_NAME(o.parent_object_id) AS table_name ,OBJECT_NAME(o.object_id) AS constraint_name FROM sys.sql_dependencies...
Within SQL Server 2005: if Exists( select * from sys.columns where Name = N '<ColumnName>' and Object_ID = Object_ID ( N '<TableName>' ) ) begin --write your own code print relevant code columns for existence end else begin --write your own code print relevant code columns...