title: find if there is a 6 digit number within a string
body: <p>How would you advise to find out in Sql Server 2010/2012 if a query contains a substring equal to a 6 digits number?</p>
  
  <p>e.g. "<code>agh123456 dfsdfdf</code>" matches the requirements</p>
  
  <p>"<code>x123 ddd456</code>" doesn't match the requirements because the 6 digits are not consecutive</p>
  
  <p>"<code>lm123</code>" doesn't match the requirements because only 3 digits are found (out of the required 6)</p>
  
  <p>The problem I encountered so far: is that SUBSTRING as a function requires parameters  (position where the number presumably starts and this is random)
  while PATINDEX returns the location of a pattern in a string, but we don't know the exact pattern (it can be any 6 digit number)</p>
  
  <p>Any pointers or advice, much appreciated.</p>
  
  <p>Thank you</p>