Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

How check constaint works?

$
0
0
Hi All!I have added check constraint on table. I am calling one function in that check constraint.Actually I have to prevent two records of same type should not have same date range as a result of update. Added check constraint like...ALTER TABLE TABLENAME WITH NOCHECK ADD CONSTRAINT [CHK_TABLENAME] CHECK ((dbo.PAEXTENDADD_DUPLICATECHK (ID, VALIDFROM, VALIDTO) = 1))goJust want to know how does it works?? I mean is it work like first update will be done then go for check constraint validation. if check constraint violated then it will rollback.is it so??Many thanks

Viewing all articles
Browse latest Browse all 3145

Trending Articles