Question: ```
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` to accept only upper case letters. Which constraint to add?

```
alter table EmployeeStatistics
#add constraint

```

Answer: 
You can use a check constraint where you compare the value with the [upper case](https://msdn.microsoft.com/en-us/library/ms180055.aspx) value using a binary collation or a case sensitive collation.

```
alter table dbo.EmployeeStatistics 
  add constraint CK_EmployeeStatistics_Position
  check (upper(Position) = Position collate Latin1_General_BIN2)

```
Actually, rather than adding a constraint to only *accept* uppercase, I would be looking into a simple trigger to *force* it to uppercase.

There's little point in annoying a user of your database when they enter lowercase when it can be fixed quite easily without loss of information. Some people dislike silent changes to data but I've always thought that it's preferable to generating unnecessary errors, provided the behaviour is well advertised.

That's going to be something like:

```
CREATE TRIGGER UpperPosition ON EmployeeStatistics
FOR INSERT, UPDATE AS
    UPDATE T SET T.Position=Upper(T.Position)
    FROM EmployeeStatistics T
    INNER JOIN inserted I ON (T.ID = I.ID)

```

to create the trigger, and a one-time:

```
UPDATE EmployeeStatistics
SET Position = Upper(Position)

```

to change all current rows.

Just be careful if you have any foreign key constraints using that column, making them uppercase may well break the constraint.