Hi
I am trying to compare two columns in different databases (using linked server connection). Both columns are phone numbers but one of the columns is xml data. When I run the following query:
SELECT
Cast(a.XML_Data as XML) as XML_Data, b.phone
FROM
OPENQUERY(NJRAPDB01,'
SELECT
Cast(dlr_reference_num as Varchar(max)) as XML_DATA
FROM
marlin.dbo.dealer') a, marlin_x.dbo.vendor b
Where Cast(a.XML_Data as XML) = b.phone
I get this error:The data types xml and char are incompatible in the equal to operator
Any suggestion would be appreciated.
Doug