IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[fn_Oran]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
BEGIN 
DECLARE @SQL VARCHAR(4000) = '
create function [dbo].[fn_Oran]
( @Bolunen float = 0.0, 
  @Bolen   float = 0.0
) RETURNS float 

as

BEGIN

  return ( case
      
             when @Bolen  
                = 0.0
             then 0.0
  
             else  @Bolunen / @Bolen
    
           end 
         ) 

END
'

EXEC(@SQL)
END