Skip to main content
黑话筒

SQL Server:请不要在新创建的表中使用NText

有同事遇到SQL Server中NVARCHAR和NTEXT不能比较的问题。查了MSDN,看到以下信息,觉得比较重要,摘抄上来:

Important

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

Fixed and variable-length data types for storing large non-Unicode and Unicode character and binary data. Unicode data uses the UNICODE UCS-2 character set.

也就是说新写的代码需要使用nvarchar(max)代替ntext,因为ntext类型可能会在将来的版本被删掉。并且需要制定计划,修改现有代码中ntext为nvarchar(max)。

原文地址:http://technet.microsoft.com/en-us/library/ms187993.aspx