title: Can I build a string using sql server case statements?
body: <p>Is it possible to do something like this in SQL server 2008: </p>
  
  <pre><code>CASE WHEN var1 = 1 THEN 'message 1 ' END as messages
  CASE WHEN var2 = 1 THEN 'message 2 ' END as messages 
  </code></pre>
  
  <p>Where messages would result in <code>message 1 message 2</code> if both variables were true. </p>
  
  <p>I do realize I can do a subquery and create the messages, but I was curious as to whether it could be done without a subquery or <code>with</code> statement. </p>