What data type is best for storing comments in SQL Server?

What is an efficient data type in SQL 2005 for storing comment fields?

+4
source share
3 answers

If the comment will always match 8000 characters, then varchar(8000) (or nvarchar(4000) ).

Otherwise a varchar(max)

+6
source

It depends on whether you limit the length of the comment. In SO, nvarchar(600) does this. On a blog, you probably want nvarchar(max) .

+1
source

Apparently, SQL 2005 only supports:

varchar (max) Uneven data of variable length with variable length not more than 2 ^ 31 characters.

If you need Unicode character strings,

nvarchar (max.) Unicode data with a variable length of not more than 2 ^ 30 characters.

text is also supported as a data type. Use this site if you need an additional link:

http://www.teratrax.com/sql_guide/data_types/sql_server_data_types.html

0
source

All Articles