XML XQUERY Problem with NTEXT data type

Posted by johnfa on Stack Overflow See other posts from Stack Overflow or by johnfa
Published on 2010-04-23T14:58:23Z Indexed on 2010/12/29 23:54 UTC
Read the original article Hit count: 112

Filed under:
|

Hello

I want to use XQuery on a column of data type NTEXT (I have no choice!). I have tried converting the column to XML using CONVERT but it gives the error:

Incorrect syntax near the keyword 'CONVERT'.

Here's the query

SELECT 
    y.item.value('@UserID', 'varchar(50)') AS UnitID,   
    y.item.value('@ListingID', 'varchar(100)') AS @ListingID  
FROM   
    dbo.KB_XMod_Modules
    CROSS APPLY     
    CONVERT(xml, instancedata).nodes('//instance') AS y(item)

(instancedata is my column)

Can anyone think of a work around for this ?

Thanks

© Stack Overflow or respective owner

Related posts about sql

Related posts about xqueryengines