---- UnomValueByID ----
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UnomValueByID]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[UnomValueByID]
GO
create function UnomValueByID(@ID int)
returns float
as
begin
  declare @Res int
  if @ID=1 set @Res=1150 else
  if @ID=2 set @Res=750 else
  if @ID=3 set @Res=500 else
  if @ID=4 set @Res=330 else
  if @ID=5 set @Res=220 else
  if @ID=6 set @Res=110 else
  if @ID=7 set @Res=35 else
  if @ID=8 set @Res=10 else
  if @ID=9 set @Res=6 else
  if @ID=10 set @Res=0.4 else
  set @Res=0
  return @Res
end
