title: Creating a table with date as range partition in SQL Server 2012
body: <p>I am new to SQL Server coding. Please let me know how to create a table with range partition on date in SQL Server</p>
  
  <p>A similar syntax in teradata would be the following (a table is created with order date as range partition over year 2012 with each day as single partition  )</p>
  
  <pre><code>CREATE TABLE ORDER_DATA (   
     ORDER_NUM INTEGER NOT NULL 
     ,CUST_NUM INTEGER 
     ,ORDER_DATE DATE 
     ,ORDER_TOT DECIMAL(10,2) 
  ) 
  PRIMARY INDEX(ORDER_NUM) 
  PARTITION BY (RANGE_N ( ORDER_DATE BETWEEN DATE ‘2012-01-01’ AND DATE 2012-12-31 EACH INTERVAL ‘1’ DAY)); 
  </code></pre>
  
  <p>Thanks in advance</p>