title: Splitting a Column Using a Separator Character in SQL Server
body: <p>Here is an example row of data stored in this column</p>
  
  <pre><code>'88922774 8785075 9417025' 
  </code></pre>
  
  <p>I am trying to return all 3 separate numbers with the <code>' '</code> separator. It's also possible for there to be a 4th column in some cases.</p>
  
  <p>Usually for splitting strings I would have used the following </p>
  
  <pre><code>PARSENAME(REPLACE([ColumnName], ' ', '.'), 1) 
  PARSENAME(REPLACE([ColumnName], ' ', '.'), 2) 
  PARSENAME(REPLACE([ColumnName], ' ', '.'), 3)
  PARSENAME(REPLACE([ColumnName], ' ', '.'), 4)
  </code></pre>
  
  <p>However this is not returning any data for this particular table and I do not understand why that is. Because if I execute the following for example I see the expected result:</p>
  
  <pre><code>Select 
      PARSENAME(REPLACE('A Test Name', ' ', '.'), 1),
      PARSENAME(REPLACE('A Test Name', ' ', '.'), 2),
      PARSENAME(REPLACE('A Test Name', ' ', '.'), 3) 
  </code></pre>
  
  <p>I have tried using <code>substring()</code> instead but am only able to return the first and second items from the string, but not the third. </p>
  
  <p>Assistance would be appreciated. </p>
  
  <p>My expected output is this: rextester.com/ACFL85345</p>
  
  <p>However what I actually see is NULL values. I'm using SQL server 2005. </p>