SQL 2008 - varchar(max) vs text data types

Madam Zu Zu picture Madam Zu Zu · Sep 12, 2011 · Viewed 14.6k times · Source

Possible Duplicate:
SQL Server Text type vs. varchar data type
Using varchar(MAX) vs TEXT on SQL Server

from this article, it looks like they both have the same size capacity: http://msdn.microsoft.com/en-us/library/ms143432.aspx

is that truly correct? what are the real differences?

i just migrated some data from oracle (clob and made it into a varchar(max), but it looks like it truncated some of the values anyway, should i use TEXT instead?

Thank you!

Answer

Aaron Bertrand picture Aaron Bertrand · Sep 12, 2011

No, you should not use TEXT. For one, it has been deprecated since SQL Server 2005, and also you will find that many string operations do not work against it. Do not use TEXT, NTEXT or IMAGE at all - use VARCHAR(MAX), NVARCHAR(MAX) or VARBINARY(MAX) instead.