1

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?

indect
  • 41
  • 1
  • 5
  • Possible duplicate http://stackoverflow.com/questions/4341613/alternatives-to-replace-on-a-text-or-ntext-datatype – sumit Jul 22 '14 at 15:27

4 Answers4

4

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

shree.pat18
  • 21,449
  • 3
  • 43
  • 63
0

varchar(MAX) and nvarchar(MAX). Try 'em; you'll like 'em.

Stuart Ainsworth
  • 12,792
  • 41
  • 46
0

If you're using SQL 2005+, you could use n / varchar(max) instead. nvarchar will use unicode, and varchar will use ascii. If this is used to store blog text, then I would go with nvarchar(max)

Christian Phillips
  • 18,399
  • 8
  • 53
  • 82
0

If you finished reading the paragraph on the MSDN page you linked, which explained that they were being removed, you would have found your answer:

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.

Siyual
  • 16,415
  • 8
  • 44
  • 58