Here is an example template in sql server for this.
create table #Something ( SomeValue varchar(255) , constraint MyCheck CHECK (SomeValue like '[az][az][0-9]%') ) insert #Something select 'ab3adoofnod' --(1 row(s) affected) insert #Something select 'a3b3adoofnod' Msg 547, Level 16, State 0, Line 1 The INSERT statement conflicted with the CHECK constraint "MyCheck". The conflict occurred in database "tempdb", table "dbo.#Something__________________________________________________________________________________________________________0000000000DD", column 'SomeValue'. The statement has been terminated.
If you want to use some t-sql to view the definitions of your test constraints, you can use the sys.check_constraints directory view.
Here is an example of viewing ALL test constraints for the table above. The definition columns will search for wildcards as defined in the restriction.
select * from tempdb.sys.check_constraints where parent_object_id = object_id('tempdb..#Something')
source share