Adding upper case letter only constraint in SQL Server -
create table employeestatistics ( employeeidno int, name varchar(30), salary integer, benefits integer, position varchar(25), allowance integer, dateofbirth integer, telephone integer, primary key (employeeidno) );
i want position
accept upper case letters. constraint add?
alter table employeestatistics #add constraint
you can use check constraint compare value upper case value using binary collation or case sensitive collation.
alter table dbo.employeestatistics add constraint ck_employeestatistics_position check (upper(position) = position collate latin1_general_bin2)
Comments
Post a Comment