suitable data type to save string larger than 8000 charachter

2.4k views Asked by At

what is the suitable data type to save string more than 8000 character in SQL database?

1

There are 1 answers

5
Martin Smith On BEST ANSWER

For SQL Server 2005+ varchar(max) or nvarchar(max) depending on whether you need to save as unicode or not.

If you don't have this requirement (or anticipate ever needing it) the varchar option is more space efficient.

You don't give a specific version of SQL Server in your question. Pre 2005 it would have been the text datatype.

NB: In answer to your comment use 'varchar(max)' exactly as written. Don't substitute a number in for "max"!