SQL Server 2005 and 2012

Hello Experts,

I created a linked server (on a networked  computer/SQL Instance) and am accessing two tables in the a linked server (via a select query) from my local server instance.,

1. The two table query ("pack" table and "material" table with INNER JOIN) initially failed with this error msg:

Msg 9514, Level 16, State 1, Line 2
Xml data type is not supported in distributed queries. Remote object 'MYLINKEDSERVER.production.dbo.material' has xml column(s).

I tried this in SQL Server 2005 and SQL Server 2012 with same results...

2. I looked at the material table and it does indeed have an XML datatype column although I am not querying this column at all.

3. As a test I modified the SELECT statement to only access the pack table (has no XML datatype column). This select statement works fine.

After some research it appears that distributed queries do not support XML data even if you explicitly SELECT only non-XML data columns. I think I read that the entire table gets copied over in a distributed query,

Does anyone know how to get around this limitation without modifying the Linked (remote) server in any way?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vikas GargBusiness Intelligence DeveloperCommented:

You can try one of these

1. Create a view which should not have column with XML Data Type

2. Convert the Column which has XML Data type to Nvarchar(max) or Nvarbinary(max)

Hope this will help you to resolve your problem.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SaxitalisAuthor Commented:
Thanks for the reply.

1. I am not calling the XML column in my view query as I do not need data from it.

2. I added the xml data column to my query with CONVERT(Nvarchar(MAX),[xmldata]) AS [xmldata] but get same error:

Msg 9514, Level 16, State 1, Line 1
Xml data type is not supported in distributed queries. Remote object 'INNOVAREMOTE05.Innova.dbo.proc_materials' has xml column(s).
SaxitalisAuthor Commented:
Thanks - this helped me get on the right track - I had to convert all data to varchar in a temp table first...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.