Click here to Skip to main content
15,920,687 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am trying to insert data to tables in remote DB via Linked Server I am getting exception on fetching data from Tables with Xml Column data type on executing below query .
i tried open query as below.
SQL
INSERT INTO OPENQUERY([LNK_228], 'SELECT CustomerDetailID, CustomerId, AccountNo, CustomerName, EmailIds, IsActive, IsDeleted, CreatedBy, CreatedDate, ModifiedBy, ModifiedDate FROM [FTS_DIB_ARCH2].dbo.CustomerDetails')
SELECT CustomerDetailID, CustomerId, AccountNo, CustomerName, EmailIds, IsActive, IsDeleted, CreatedBy, CreatedDate, ModifiedBy, ModifiedDate 
FROM FTS_DIB_ARCH_TEST.dbo.CustomerDetails

I also tried SELECT * FROM OPENQUERY([LNK_228], 'SELECT EmailIds FROM [FTS_DIB_ARCH2].dbo.CustomerDetails') for which same exception occurs.

Getting exception:Xml data type is not supported in distributed queries. Remote object 'OPENQUERY' has xml column(s).

What I have tried:

i tried open query for table with columns having Xml Column Type as below.
SQL
INSERT INTO OPENQUERY([LNK_228], 'SELECT CustomerDetailID, CustomerId, AccountNo, CustomerName, EmailIds, IsActive, IsDeleted, CreatedBy, CreatedDate, ModifiedBy, ModifiedDate FROM [FTS_DIB_ARCH2].dbo.CustomerDetails')
SELECT CustomerDetailID, CustomerId, AccountNo, CustomerName, EmailIds, IsActive, IsDeleted, CreatedBy, CreatedDate, ModifiedBy, ModifiedDate 
FROM FTS_DIB_ARCH_TEST.dbo.CustomerDetails

I also tried SELECT * FROM OPENQUERY([LNK_228], 'SELECT EmailIds FROM [FTS_DIB_ARCH2].dbo.CustomerDetails') for which same exception occurs.
Posted
Updated 26-Apr-16 19:54pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900