title: IsNumeric does not work in SQL server
body: <p>Getting very annoyed with this simple query...<br>
  I need to add an offset to a varchar, if it's a number and do nothing is it is not.<br>
  For this reason I've created the following function in SQL-server.
  I then extract the answer with:
  <code>select dbo.OffsetKPL("100",200)</code></p>
  
  <p>However this does not work, I get the error</p>
  
  <blockquote>
    <p>Msg 207, Level 16, State 1, Line 1<br>
    Invalid column name '100'.</p>
  </blockquote>
  
  <p>The code for the function is as follows...</p>
  
  <pre><code>ALTER FUNCTION [dbo].[OffsetKPL](
    @kpl varchar(20)
    ,@offset int = 0
  )
  RETURNS varchar(20)
  AS
  BEGIN   
    DECLARE @uitkomst varchar(20);
  
    set @uitkomst = @kpl;
    if not(@offset = 0) begin
      if (IsNumeric(@uitkomst) = 1) begin
        set @uitkomst = cast((cast(@kpl as int) + @offset) as varchar);
      end;
  end;
  
  RETURN @uitkomst;
  
  END
  </code></pre>
  
  <p>What's wrong? nowhere does it state that IsNumeric does not accept a variable.</p>