User defined table type with a check constraint
Although table types do allow unnamed CHECK constraints, it is not possible to use a user-defined function inside one.

The error message is:


  Msg 2785 Level 16 State 1 Line 3
  User-defined functions, user-defined aggregates, CLR types, and methods on CLR types are not allowed in expressions in this context.
  Msg 1750 Level 16 State 0 Line 1
  Could not create constraint. See previous errors.


See the db&lt;>fiddle demo