Tuesday, June 26, 2012

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

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

Solution:

[code]
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
[/code]

No comments: