sqltextcharvarcharntext

SQL: Alternative to text and ntext data type?


I'm currently designing a MS SQL table for use in a project. The problem I'm currently facing is that the data types of "Transact SQL " are pointing to the deprecation of the types "text" and "ntext", which I always used for big texts.

Char, nchar, varchar and nvarchar may only be 8000 bytes big, this just isn't enough for a user input text, e. g. if he's writing a big article.

Is there any alternative to the obsolete data type text/ntext?


Solution

  • Using nvarchar(MAX) will allow you to store up to 2 GB of data. The same goes for varchar(MAX) too.