简体   繁体   中英

Store huge amount of data in SQL Server

create table article
(
     ArticleID int constraint cnst-name Primary key,
     Description datatype
)

I am creating this table in SQL Server 2014. I am trying to create a table where I can store articles with huge data (it can be 1000-2000 words article description). I don't know which data type to choose for description column.

I chose varchar(max) but there is a limitation that each row has to be <= 900 bytes. Please guide me if my table structure is right.

Thanking in anticipation.

Use VARCHAR(max) . 2000 words in a .txt file is around 13kb. I would not call that 'huge'.

I would use nvarchar(max) . Unlike varchar is supports unicode. The limit 2GB should be enough.

The limit of row size is 8060B, so You can not store more than about 4000 unicode characters in the row. But the restriction does not apply here, because nvarchar(max) is not stored in the row. The row contains pointer only. This one indirection is the price for the "unlimited" size.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM