title: SQL - How to return a set of numbers after a specific word
body: <p>In SQL i'm trying to return the first set of numerical values after a specific word. I only want the numbers from the string after the specific word.
  eg:  ' hello : '</p>
  
  <p>for example:</p>
  
  <pre><code>hello : 123            should return 123
  hello : x123           should return 123
  hello : 123 456        should return 123
  cake : 10              should not return anything
  </code></pre>
  
  <p>So far I've worked out i need to do something like -</p>
  
  <pre><code>Declare @sInitialString varchar(max)
  @sInitialString = " hello hello : 123 456"
  --FIND ' hello : ' within @sInitialString
  -- possibly save this a new substring or string?
  -- find the first numerical value after this has been found
  </code></pre>
  
  <p>Seems simple but from previous posts it seems more complex.</p>
  
  <p>I've managed to get all numerical values to return</p>
  
  <pre><code>DECLARE @sInitialString VARCHAR(MAX)
  
  SET @sInitialString = (SELECT UPPER(' hello hello : 123 '))
  select substring(@sInitialString,patindex('%[0-9]%',@sInitialString),100)
  </code></pre>
  
  <p>I just seem to be missing something either in my approach or the solution. Has anyone managed to achieve this?</p>