title: Errors using UNION in SQL Server
body: <p>I tried to understand how UNION works in SQL Server by executing the following script:</p>
  
  <pre><code>select * 
  from Production.ProductModel
  where ProductModelID IN (3,4, 5, 6)
  UNION
  select * 
  from Production.ProductModel
  where ProductModelID NOT IN (3,4, 5, 6)
  </code></pre>
  
  <p>Got following error: </p>
  
  <blockquote>
    <p>The data type xml cannot be used as an operand to the UNION, INTERSECT or EXCEPT operators because it is not comparable.</p>
  </blockquote>
  
  <p>It seems few other people got similar and posted in stack overflow; but, unfortunately I didn't understand the explanation by some champs. Can any please help me to understand.</p>