-- Check constraints cannot refer to other tables, but can call a function alter table YourTable add constraint chk_CheckFunction check (dbo.CheckFunction() = 1)