SSIS and Sql Server Journey

Personal Notes of Sarabjit Singh and Bhavpreet Singh

linked Server Query: Fetching data from table with column of datatype “XML”

on June 26, 2012

ERROR: Xml data type is not supported in distributed queries. Remote object ‘server_name.database_name.dbo.table_name’ has xml column(s).

Solution:

SELECT * FROM

(
SELECT * FROM OPENQUERY([server_name],'SELECT column_1, column_2,CAST (column_XML as varchar(max)) Converted_column_XML
 FROM
 database_name.[dbo].table_name')

)AS X
Advertisements

One response to “linked Server Query: Fetching data from table with column of datatype “XML”

  1. I like what you guys are up too. This type of
    clever work and exposure! Keep up the wonderful works guys I’ve incorporated you guys to blogroll.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: