NVARCHAR (MAX) replace data type TEXT?

I read about Are there any drawbacks to always using nvarchar (MAX) and varchar (max) vs varchar (255) from various forums. Now, I wonder if it's ideal / safe practice to convert datatype text

to nvarchar(MAX)

? Is there a performance difference? or do I need to specify the size (as in nvarchar(255)

) instead nvarchar(MAX)

?

+3


source to share


1 answer


The answer is very simple: the text

type is deprecated. So yes, you have to convert the datatype text

to varchar(MAX)

.

https://msdn.microsoft.com/en-AU/library/ms187993.aspx

text, text, and graphic data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development and plan to change the applications that currently use them. Use nvarchar (max), varchar (max), and varbinary (max) instead.



Also, if you know your size is text

less than 8000, use varchar(nnn)

instead varchar(MAX)

. varchar(nnn)

more efficient than varchar(MAX)

.

Note. text

type is for non-unicode text, so use varchar

. ntext

is for unicode text, so use nvarchar

.

+4


source







All Articles