title: Split string into three variables in SQL Server 2005
body: <p>I have an string</p>
  
  <pre><code>declare @s varchar(100),
  set @s='aaaa,bbbb,cccc'
  
  declare @first varchar(100),
  declare @second varchar(100),
  declare @third varchar(100)
  </code></pre>
  
  <p>Now I need to split these strings into three variable holding there values like this</p>
  
  <pre><code>@first=aaaa
  @second=bbbb
  @third=cccc
  </code></pre>
  
  <p>If I am using the split function then I get the output like this</p>
  
  <pre><code>aaaa
  bbbb
  cccc
  </code></pre>
  
  <p>Is there any better way we can achieve this result? Any help would be appreciated.</p>
  
  <p>I want this result into a variable because I need it for further processing </p>
  
  <p>Thanks</p>