title: Sql Server ISERROR function
body: <p>I have a function that returns the format of formula.some part of it----</p>
  
  <pre><code>  if(CHARINDEX(@fieldname,@formula)&lt;&gt;0)
              Begin         
                  declare @previouschar char = SUBSTRING(@formula, CHARINDEX(@fieldname, @formula)-1, 1), 
                          @nextchar char = SUBSTRING(@formula, CHARINDEX(@fieldname ,@formula)+len(@fieldname), 1)                  
                  if(@previouschar in('[',']','(',')','{','}','+','-','/','*') 
                      and @nextchar in ('[',']','(',')','{','}','+','-','/','*'))
                  Begin   
                      set @calFormula= replace(@calFormula,@fieldname,' case when FLD'+Convert(varchar,@flid)+' is null OR FLD'+Convert(varchar,@flid)+'='''' then 0.0 else Convert(decimal(18,'+ Convert(varchar,@decimalPlc) +'),FLD'+Convert(varchar,@flid)+' ) end ')
                  End
              end
          set @cnt1=@cnt1+1
      End
  
                      set @calFormula= replace(@calFormula,'[','')
                              set @calFormula= replace(@calFormula,']','')
  
   return @calFormula
  </code></pre>
  
  <p>I want to implement ISERROR method of DAX in Sql Server Relational Database that would check if any divisor entered is zero then it assigns NULL in calculated formula.How to work for this?Can there be some alternate method like ISERROR in SQL?</p>