Trick to get large data in SQL Management Studio

·

1 min read

If you have a column with long text, you can cast it to XML and get it out. Here is an example where the text is so big that it is also compressed.

SELECT 
convert(xml,'<![CDATA[‘ + cast(decompress(longTextColumn) as nvarchar(max)) + ‘]]>’) as LongText
FROM [My].[TableWithLongText]