title: sql varchar(max) vs varchar(fix)
body: <p>Every time I confused for selecting varchar(max) or varchar(fix) datatype. suppose I have a data column that will be around 5000 varchar. a column is not null type.</p>
  
  <p>should i set it varchar(max) not null or varchar(5000) not null.</p>
  
  <p>same thing in case of a nullable data type. </p>
  
  <pre><code>CREATE TABLE [dbo].[tblCmsPages](
  [CmsPagesID] [int] IDENTITY(1,1) NOT NULL,
  [PageName] [varchar](250) NOT NULL,
  [PageContent] [varchar](max) NOT NULL,
  [Sorting] [int] NOT NULL,
  [IsActive] [bit] NOT NULL) 
  </code></pre>
  
  <p>//or</p>
  
  <pre><code>CREATE TABLE [dbo].[tblCmsPages](
  [CmsPagesID] [int] IDENTITY(1,1) NOT NULL,
  [PageName] [varchar](250) NOT NULL,
  [PageContent] [varchar](5000) NOT NULL,
  [Sorting] [int] NOT NULL,
  [IsActive] [bit] NOT NULL
  </code></pre>
  
  <p>//[PageContent] will be 5000 char or single char or null then what should i take.</p>
  
  <p>One another think I want to know. What is the main difference between <strong>null</strong> and <strong>not null</strong>. Is it only for validation check and what is an effect on performance.</p>