Search code examples
c#asp.netsql-servert-sqlrdbms

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.


Solution

  • 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.