Getting Started with ASP.NET MVC - Part 6: ASP.NET MVC and Entity Framework
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.


Upload Image Close it
Select File

Learned something today? Share it, or learn from what others have learned today

SQL Server error "Xml data type is not supported in distributed queries" and workaround for it

Sep 6 2011 4:19AM by Paresh Prajapati   

Recently while working with data migration,got an error while running a following query where Server2 has beed added as linked server.

SELECT 
* 
FROM Server1.Database1.dbo.Table1 
WHERE Column1 NOT IN
(SELECT Column1 FROM Server2.Database2.dbo.Table1)
GO

-- Error raised while run above query
"Xml data type is not supported in distributed queries. Remote object 'Server2.Database2.dbo.Table1' has xml column(s)."

Server2.Database2.dbo.Table1 objects has another column named 'column2' has xml datatype and we have not used it anywhere in query. We used 'column1' of that table only and it has not xml datatype, even it has raised error. For the solution to avoid such error i have revised query as following.

SELECT 
* 
FROM Server1.Database1.dbo.Table1 
WHERE Column1 NOT IN
    (
    SELECT
    	  *
    FROM
    OPENQUERY(Server2,'
    			SELECT 
    			Column1
    			FROM Database2.dbo.Table1'
    		) linked
    )

And query ran with success. Have you received this type of error earlier? You may share here.

Read More..  [0 clicks]


Paresh Prajapati
7 · 24% · 5512
8
 
1
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten
 
0
Move



Submit

1  Comments  

  • commented on Feb 27 2012 10:04PM  .  Report Abuse This post is not formatted correctly
    a123456
    2307 · 0% · 2

Your Comment


Sign Up or Login to post a comment.

"SQL Server error "Xml data type is not supported in distributed queries" and workaround for it " rated 5 out of 5 by 8 readers
SQL Server error "Xml data type is not supported in distributed queries" and workaround for it , 5.0 out of 5 based on 8 ratings
    Copyright © Beyondrelational.com Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising