title: Why do I get the error "Xml data type is not supported in distributed queries" when querying a linked server for non-xml data?
body: <p>I have two SQL Servers (running SQL Server 2008) named <code>DATA01</code> and <code>DATA02</code>. <code>DATA02</code> has a linked server definition <code>LINK</code>, that points at <code>DATA01</code>, with suitable user mapping set up. On <code>DATA01</code> there is a database <code>MyDatabase</code> containing these two tables:</p>
  
  <pre><code>CREATE TABLE T_A (
      Id int
  )
  
  CREATE TABLE T_B (
      Id int,
      Stuff xml
  )
  </code></pre>
  
  <p>When I run this command from <code>DATA02</code>, I get data returned as expected:</p>
  
  <pre><code>SELECT Id FROM LINK.MyDatabase.dbo.T_A;
  </code></pre>
  
  <p>However, when I run this command from <code>DATA02</code>, I get an error:</p>
  
  <pre><code>SELECT Id, Stuff FROM LINK.MyDatabase.dbo.T_B;
  </code></pre>
  
  <p>The error is</p>
  
  <blockquote>
    <p>Xml data type is not supported in distributed queries. Remote object 'DATA02.MyDatabase.dbo.T_B' has xml column(s).</p>
  </blockquote>
  
  <p>And strangely, this command:</p>
  
  <pre><code>SELECT Id FROM LINK.MyDatabase.dbo.T_B;
  </code></pre>
  
  <p>also gives the same error, <strong>even though I'm not <code>SELECT</code>ing the xml column!</strong> What's going on?</p>