Limiting NVARCHAR size in SQLServer?

kjv picture kjv · May 28, 2009 · Viewed 7.2k times · Source

I was wondering what would be the consequences of setting NVARCHAR fields to MAX instead of a specific size in SQL Server 2008, and limiting the input from the application's logic. Also, would these be a bad design practice?

Answer

Robin Day picture Robin Day · May 28, 2009

NVARCHAR(MAX) is a lot better at performing with smaller data than the old NTEXT data type, however, NVARCHAR(n) will always be more efficient in some areas.

As a general rule, using the datatype that best represents the data you are storing is almost always the best practice.