title: SQL query to print each character of a string : SQL server
body: <p>Trying to write a query for printing each character of a string separately. I have tried the following</p>
  
  <pre><code>select substring('sas',1,1)
  union all
  select substring('sas',2,1)
  union all
  select substring('sas',3,1)
  
  </code></pre>
  
  <p>But I would have to run  union all for each character. Any better approach to this?</p>
  
  <p>Sandbox: <a href="http://sqlfiddle.com/#!9/9eecb/123683" rel="nofollow noreferrer">http://sqlfiddle.com/#!9/9eecb/123683</a></p>