title: sql Function not returning value
body: <p>Wrote a function for accepting a Number and a user id and returning a table having individual digit in a single row with that User id. Function created successfully but when i tried to execute function its returning a blank table.
  Attaching screenshot of function and output.</p>
  
  <p><img src="https://i.stack.imgur.com/ZLfRM.png" alt="enter image description here"></p>
  
  <pre><code>Create Function ExtractingDigits(@InputNumber INT, @UserId varchar)
      RETURNS @ReturnTable Table(UserId Varchar(20),  ModNumber Int)
  as
  begin
  Declare @ModNumber Int
  While @InputNumber!=0
  begin
  set @ModNumber= @InputNumber%10
  set @InputNumber=@InputNumber/10
  insert into @ReturnTable(UserId, ModNumber)
  select * from @ReturnTable
  end
  return
  end
  
  select * from ExtractingDigits(123, 'as')
  </code></pre>