title: Sql single column to multiple on '.' delemiter
body: <p>I have a column with data as <code>abc.123</code>, <code>def.345</code> and so on. It is basically a name followed by a <code>.</code> and then a code. I am able to divide them using </p>
  
  <pre><code>select 
  LEFT(Campaign, ISNULL(NULLIF(CHARINDEX('.', Campaign + ' ') -1, -1), LEN(Campaign))),
  STUFF(Campaign, 1, Len(Campaign) +1- CHARINDEX('.',Reverse(Campaign)), '')
   from myTable; 
  </code></pre>
  
  <p>Input set:</p>
  
  <pre><code>| myColumn |
  | abc.123  |
  | def.345  | 
  |  444     |
  </code></pre>
  
  <p>However, for data like '444' it shows:</p>
  
  <pre><code>|Name| Code |
  |abc | 123  |
  |def | 345  | 
  |444 |      |    (SHOULD BE =&gt; |   |  444 |)
  </code></pre>
  
  <p>Assumptions:
  Data can be without a '.' In such case we can insert the data in either Name or Code depending on datatype ie  Name=>Alphanumeric, Code=>Numeric.
  eg: Data like</p>
  
  <pre><code>999 =&gt;     |     | 999 |
  a24.345 =&gt; | a24 | 345 |
  a72     =&gt; | a72 |     |
  </code></pre>