2

I'm making a blog, article website so i decide to use NTEXT data type for blog and article contents. Until i see this

Important

ntext, text, and image data types will be removed in a future version of MicrosoftSQL 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. (http://msdn.microsoft.com/en-us/library/ms187993.aspx)

Im sure that blog and article contents gonna reach 4000 character limit if i use nvarchar(max). What data type should i use at this case?

jww
  • 97,681
  • 90
  • 411
  • 885
timu
  • 828
  • 7
  • 20
  • 40

1 Answers1

10

You should use nvarchar(max)/varchar(max) - that's current pair of text types.

When using these types you have no limit for field size (well, actually the limit is 2 Gb, but I don't think you'll hit it).

See MSDN for more details:

AlexS
  • 2,388
  • 15
  • 15
  • Are you sure of that? I remember facing issues when using nvarchar when we reached 4k charaters. – Roopesh Shenoy Nov 11 '10 at 19:07
  • 2
    Absolutely sure. Most likely you were using sized nvarchar field, i.e. the one with fixed max length (like nvarchar(2000)). In this case there's a limit on maximum length value and it is 4000 symbols (which is 8000 bytes which is a limit for max size of varchar fields of fixed max length). – AlexS Nov 11 '10 at 19:17