title: Separate comma values into individual values
body: <p>I need to separate columns in SQL Server </p>
  
  <p>Table: columnsseparates</p>
  
  <pre><code>CREATE TABLE [dbo].[columnsseparates](
      [id] [varchar](50) NULL,
      [name] [varchar](500) NULL
  ) 
  INSERT [dbo].[columnsseparates] ([id], [name]) VALUES (N'1,2,3,4', N'abc,xyz,mn')
  GO
  INSERT [dbo].[columnsseparates] ([id], [name]) VALUES (N'4,5,6', N'xy,yz')
  GO
  INSERT [dbo].[columnsseparates] ([id], [name]) VALUES (N'7,100', N'yy')
  INSERT [dbo].[columnsseparates] ([id], [name]) VALUES (N'101', N'oo,yy')
  
  GO
  </code></pre>
  
  <p>based on above data I want output like below:</p>
  
  <pre><code>id   |  Name 
  1    |abc
  2    |xyz
  3    |mn
  4    |null
  4    |xy
  5    |yz
  6    |null
  7    |yy
  100  |null
  101  |oo
  null |yy
  </code></pre>
  
  <p>How to achieve this task in SQL Server?</p>