New .net programmer here. As a new programmer, I always try to follow the best practices that I can when I am working. Today I started with SQL Server, and I asked co-worker which data type should I use for a user description column. He told me to use nvarchar(MAX)
and I did and it worked great.
However, should we always use nvarchar(max)
for this cases? or is it better to assign something like 500 characters?
I ask because I googled a little bit and I saw people saying that nvarchar(max)
reserves a lot of memory for the column, which could reduce the performance of the database eventually.
Edit: Awesome answers guys, I´m clear on the topic now. No unicode stuff, therebefore im gonna go for varchar(600)
max
then. They are less efficient than non max data types and have more limitations. They should only be used when you actually need the extra length.