Is there a performance improvement to be had by using XML rather than NVARCHAR(max)?

lucky51

New Member
i am going to be storing some text in a database. The text happens to be xml.i'm only storing and reading the "blob" of text (i am not using any of the xml querying or indexing facilities).Is there any advantage to declaring the column as \[code\]xml\[/code\]:\[code\]CREATE TABLE docs (pk INT PRIMARY KEY, xCol XML not null)\[/code\]rather than \[code\]nvarchar(max)\[/code\]:\[code\]CREATE TABLE docs (pk INT PRIMARY KEY, xCol NVARCHAR(max) not null) \[/code\]i figure that if i give SQL Server the hint that the \[code\]text\[/code\] is actually \[code\]xml\[/code\], then it can apply compression for more efficient storage.Note: The third option is for me to compress the text client-side and store the data in a \[code\]varbinary(max)\[/code\] blob column.
 
Back
Top