Pages

Monday 28 January 2013

ms sql xml data type convert to text


A simple cast will suffice:
select cast(XMLCol as nvarchar(max)) as XMLCol 
Or for non-unicode:
select cast(XMLCol as varchar(max)) as XMLCol 
You can't convert explicitly to a 'text' data type.

Try using 'varchar(max)' instead of 'text'

No comments:

Post a Comment