TeaDrinkingGeek
TeaDrinkingGeek

Reputation: 2023

Storing large amounts of text

I'm looking for a data type in SQL Server 2008 Express that can stored vast amounts of text. nvarchar(max) looks the closest, 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)

Upvotes: 1

Views: 283

Answers (5)

JonH
JonH

Reputation: 33141

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

Upvotes: 3

David
David

Reputation: 1101

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

Upvotes: 0

mwgriffith
mwgriffith

Reputation: 550

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.

Upvotes: 0

Daniel Ives
Daniel Ives

Reputation: 717

varchar(max) and nvarchar(max) both store up to 2GB, so your information was wrong.

Upvotes: 0

Tony The Lion
Tony The Lion

Reputation: 63190

You'd need a CLOB (Character Large Object), not sure if SQL Express supports those though.

Upvotes: 0

Related Questions