title: SQL Parse NVARCHAR Field
body: <p>I am loading data from Excels into database on SQL Server 2008. There is one column which is in <code>nvarchar</code> data type. This field contains the data as</p>
  
  <pre><code>Text text text text text    text text text text text.
  (ABC-2010-4091, ABC-2011-0586,     ABC-2011-0587, ABC-2011-0604)     
  Text text text text text    text text text text text. 
  (ABC-2011-0562,     ABC-2011-0570, ABC-2011-0575, ABC-2011-0588)    
  </code></pre>
  
  <p>so its text with many sentences of this kind. </p>
  
  <p>For each row I need to get the data <code>ABC-####-####</code>, respectivelly I only need the last part. So e.g. for <code>ABC-2010-4091</code> I need to obtain <code>4091</code>. This number I will need to join to other table. I guess it would be enough to get the last parts of the format <code>ABC-####-####</code>, then I should be able to handle the request. </p>
  
  <p>So the example of given above, the result should be <code>4091, 0586, 0587, 0604, 0562, 0570, 0575, 0588</code> in the row instead of the whole nvarchar value field.</p>
  
  <p>Is this possible somehow? The text in the nvarchar field differ, but the text format (ABC-####-####) I want to work with is still the same. Only the count of characters for the last part may vary so its not only 4 numbers, but could be 5 or more.</p>
  
  <p>What is the best approach to get these data? Should I parse it in SSIS or on the SQL server side with SQL Query? And how?</p>
  
  <p>I am aware this is though task. I appreciate every help or advice how to deal with this. I have not tried anything yet as I do not know where to start. I read articles about SQL parsing, but I want to ask for best approach to deal with this task.</p>