Sunday, September 9, 2007

How to find Check Constraint Definition

-- Plesae Note: Following code creates a table called TestCheckConstraint and drops it

create table TestCheckConstraint(col int,coldatetime datetime)
alter table TestCheckConstraint
add constraint coldatetime_checkcheck ( coldatetime > '20070101')
select text from syscommentswhere id = OBJECT_ID('coldatetime_check')
drop table TestCheckConstraint
go

No comments: