Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9173559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:36:28+00:00 2026-06-17T16:36:28+00:00

I have two SQL Servers (running SQL Server 2008) named DATA01 and DATA02 .

  • 0

I have two SQL Servers (running SQL Server 2008) named DATA01 and DATA02. DATA02 has a linked server definition LINK, that points at DATA01, with suitable user mapping set up. On DATA01 there is a database MyDatabase containing these two tables:

CREATE TABLE T_A (
    Id int
)

CREATE TABLE T_B (
    Id int,
    Stuff xml
)

When I run this command from DATA02, I get data returned as expected:

SELECT Id FROM LINK.MyDatabase.dbo.T_A;

However, when I run this command from DATA02, I get an error:

SELECT Id, Stuff FROM LINK.MyDatabase.dbo.T_B;

The error is

Xml data type is not supported in distributed queries. Remote object ‘DATA02.MyDatabase.dbo.T_B’ has xml column(s).

And strangely, this command:

SELECT Id FROM LINK.MyDatabase.dbo.T_B;

also gives the same error, even though I’m not SELECTing the xml column! What’s going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:36:29+00:00Added an answer on June 17, 2026 at 4:36 pm

    This is a deficiency within SQL Server. The mere existence of an xml column on the table prevents it from participating in distributed queries (eg being queried through a linked server connection). This is mentioned in this ‘retired’ documentation. There doesn’t appear to be any mention of this in the current version’s documentation.

    There used to be relevant bug reports on Microsoft Connect, but that’s now been ‘retired’ in favour of the Azure feedback forums. This feedback item is Closed with an instruction to "Please submit feedback directly from the product documentation", which would be fine if the product documentation actually mentioned this. This other feedback item includes commentary migrated from Connect, and has the status ‘Unplanned’.

    One of the Connect bug reports that used to exist gave two workarounds:

    1. Create [a] view without the XML column(s) on remote server and query that.

      In your example, this would involve adding a view to MyDatabase
      that looks like this:

      CREATE VIEW V_T_B AS SELECT Id FROM T_B;
      

      You could then query this view through the link to get the Id
      data. Note that something like

      SELECT Id FROM ( SELECT Id FROM T_B ) T_B;
      

      doesn’t work.

    2. Use a pass-through query in the form

      SELECT * from OPENQUERY (... )
      

      This method has the advantage of not requiring any change to the
      source database; the downside is that it is no longer possible to
      use standard four-part naming for both local and linked data. The
      query would look like

       SELECT Id FROM OPENQUERY(DATA02, 'SELECT Id FROM T_B') T_B;
      

      Note that if you actually do want the xml data, this method (along
      with casting to and from a non-xml datatype) will be required :

       SELECT Id, CAST(Stuff AS XML) Stuff 
       FROM OPENQUERY(DATA02, 'SELECT Id, CAST(Stuff AS nvarchar(max)) Stuff 
                               FROM T_B') T_B;
      

    Note that the bug was first reported in SQL Server 2005, and remains unfixed in SQL Server 2017. I haven’t yet been able to check SQL Server 2019.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two database servers running SQL Server 2005 Enterprise that I want to
I have two servers where I installed SQL Server 2008 Production: RAID 1 on
I have two SQL Server 2008 databases called Anna and Bob . Bob has
I'm an extreme novice running SQL SERVER 2005. I have two tables that I'm
I have two servers running Windows 2008 Web Edition and SQL 2008 Standard Edition,
Let's say I have two SQL Server databases running on separate machines, call them
I have two websites running on the same Windows 2008r2 64bit server, SQL Server
You have two servers when you perform a SQL Server database mirroring You have
I have an application running in IIS which connects to a SQL Server 2008
i'm running into a strange problem in Microsoft SQL Server 2008. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.