i have a table like this
tab1
create table tab1(ID int identity(1,1), Type varchar(10),IsValued bit)
tab1:
ID Type IsValued
----------------
1 S 1
2 R 0
3 R 0
4 S 1
5 S 1
6 R 0
7 S 1
instead of inserting value into IsValued column i want to create one constraint(NOT TRIGGER) when Type ='S' ,IsValued should be inserted as 1 and when Type ='R' ,IsValued should be inserted as 0
like : IsValued = case when Type ='S' then 1 when Type ='R' then 0 end
How can i achieve this..