0

Need to store huge dynamically produced data(string type) in SQL server. i just tried varchar(max), nvarchar(max), text, ntext each one is storing 43679 characters of data.

but when i created tables in older versions of sql server varchar max and nvarchar max stored less amount of data only(8000,4000 characters).

can any one make me clear on this maximum limits.

TheGameiswar
  • 27,855
  • 8
  • 56
  • 94
Srikanth
  • 137
  • 12
  • 7
    Sql Server Management Studio is truncating the text, select length(f) to see its true size. – Alex K. Mar 01 '18 at 12:55
  • 4
    `text` and `ntext` are deprecated, **don't use these**. `varchar(MAX)` and `nvarchar(MAX)` can store up to 2GB of data. For a `varchar`, each character uses 1 byte, and for `nvarchar` each character uses 2; so you can do the maths on how many characters you can store. :) – Thom A Mar 01 '18 at 12:55
  • See https://learn.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql and https://learn.microsoft.com/en-us/sql/t-sql/data-types/char-and-varchar-transact-sql – Peter B Mar 01 '18 at 12:57

0 Answers0