I create a table by request below
CREATE TABLE testing( test_field VARCHAR(20) CHECK(test_field like '^[a-zA-z0-9]{6,20}$') );
regex works in Javascript and the table was created successfully, but when I try to execute the insert query below, an error occurred.
INSERT INTO testing VALUES('abcde12345');
Below is the error message
The INSERT statement was contrary to the CHECK constraint "CK_testing_test_field__173876EA". The conflict occurred in the database "TEST", the table "dbo.testing", in the column "test_field".
Is there a difference between using regex in Javascript and SQL Server?
Any professional can help ???
source share