create table  a(name varchar(20),unit int) 
insert into a select 'us',8
insert into a select 'RMB',1
insert into a select 'HK Dollar',2
select * from a 
alter function caculate(@num int,@name varchar(20))
RETURNS  int
as
Begin
declare @Currency  int
select  @Currency = @num*unit from a where name = @name
return @Currency
end 
select dbo.caculate(8,'HK Dollar')