title: saving the FOR XML AUTO results to variable in SQL
body: <pre><code>select @result=@input.query('*')
  for xml raw,type  
  </code></pre>
  
  <p>Above statement will generate following alert:<br>
  Msg 6819, Level 16, State 3, Line 2<br>
  The FOR XML clause is not allowed in a ASSIGNMENT statement.</p>