plz do this way
create table #temp(
name varchar (20),
address varchar (20),
position varchar (20),
nametype1 varchar (20),
nametype2 varchar (20),
nameval varchar(20))
insert into #temp(nametype1,nametype2)values(
'BA', 'AB')
select * from #temp
update #temp set nameval=case when nametype1=nametype2 then...