title: Extract and Separate Numeric
body: <p>I have a table below.</p>
  
  <pre><code>Client Name
  -----------------------
  Mukherjee_ 2697231  Gehrmann _ 298053524
  Butt  Glen_740708968 Amanda_259055000
  Quirk  Michael_ 65941412 and Leanne _817498908
  Butt  Glen_740708968 Amanda_259055000 Tristan 3939393939
  Kryger  Aaron _ 606506375
  Krebs  Paul
  Haddrill  Clare  _ 333900499  McRedmond  Patrick _557887778
  </code></pre>
  
  <p>I need to extract the numbers only and the numbers must be separated. </p>
  
  <pre><code>Numeric
  ----------------
  2697231  298053524
  740708968 259055000
  65941412 817498908
  740708968 259055000 3939393939
  606506375
  
  333900499  557887778
  </code></pre>
  
  <p>I have used the function below, however it concatenates all the numbers together. </p>
  
  <pre><code>ALTER FUNCTION [dbo].[UDF_GetNumeric]
  (@strAlphaNumeric VARCHAR(256))
  RETURNS VARCHAR(256)
  AS
  BEGIN
      DECLARE @intAlpha INT
      SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric)
      BEGIN
          WHILE @intAlpha &gt; 0
          BEGIN
              SET @strAlphaNumeric = STUFF(@strAlphaNumeric, @intAlpha, 1, '' )
              SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric )
          END
      END
      RETURN ISNULL(@strAlphaNumeric,0)
  END
  </code></pre>
  
  <p>I'm using SQL Server 2012. </p>