Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limiting NVARCHAR size in SQLServer?

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?

like image 916
kjv Avatar asked May 28 '09 11:05

kjv


1 Answers

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.

like image 141
Robin Day Avatar answered Sep 23 '22 13:09

Robin Day