I'm looking for a data type in SQL Server 2008 Express that can stored vast amounts of text. nvarchar(max) looks the closest开发者_StackOverflow, but I read only store upto 4,000 char. Is that true? It there a data type that can store more? (I remember the memo field from days gone by)
I think instead of MEMO
you mean TEXT
, I think MS Access supported MEMO
. In any event TEXT
is deprecated and should not be used. Use varchar(max) / nvarchar(max) (unicode support). Text
did not support indexing and searching. The limit to 4000 characters is not correct.
http://msdn.microsoft.com/en-us/library/ms187993.aspx
Here is a listing of all data types supported:
http://msdn.microsoft.com/en-us/library/ms187752.aspx
varchar(max) and nvarchar(max) both store up to 2GB, so your information was wrong.
You'd need a CLOB (Character Large Object), not sure if SQL Express supports those though.
I would use the nvarchar(max) type going forward. Here are a list of reasons on why, the information is on sql server 2005 but should still be good for 2008.
Use varchar(max) as JonH said.
Microsoft introduced the VARCHAR(MAX), NVARCHAR(MAX), and VARBINARY(MAX) data types in SQL Server 2005. These data types can hold the same amount of data BLOBs can hold (2 GB) and they are stored in the same type of data pages used for other data types.
-teratrax
精彩评论