add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table tb(StudentID varchar(10) CHECK (CAST(SUBSTRING(StudentID,3,LEN(StudentID)) AS int) <= 100));
insert into tb values('sv000');
1 rows affected
insert into tb values('sv002');
1 rows affected
insert into tb values('sv003');
1 rows affected
insert into tb values('sv100');
1 rows affected
insert into tb values('sv101');
Msg 547 Level 16 State 0 Line 1
The INSERT statement conflicted with the CHECK constraint "CK__tb__StudentID__239E4DCF". The conflict occurred in database "fiddle_8430f97e73b6481d97cbde9c859b46e9", table "dbo.tb", column 'StudentID'.
Msg 3621 Level 0 State 0 Line 1
The statement has been terminated.