title: Merge two database table partitions by their partition number
body: <p>I have created four partitions in SQL Server using the following functions.</p>
  
  <pre><code>CREATE PARTITION FUNCTION fnYearsRT(DateTime)
  AS RANGE RIGHT FOR VALUES
  ('01/01/2005', '01/01/2006', '01/01/2007', '01/01/2008');
  
  CREATE PARTITION SCHEME date_partscheme
   AS PARTITION fnYearsRT
   TO (Filegroup1, Filegroup2, Filegroup3, Filegroup4,Filegroup5)
  
  CREATE TABLE Sales.ReturnsArchive
    (
       ReturnID  int  IDENTITY NOT NULL, 
       ProductID  int  NOT NULL, 
       CustomerID  int  NOT NULL, 
       ReturnDate  datetime  NOT NULL,  
       ReturnReason  char(20)  NULL  
    ) 
   ON date_partscheme (ReturnDate)
  </code></pre>
  
  <p>After inserting data I have the following stats</p>
  
  <pre><code>Partition   COUNT
  2       5151
  3       19353
  4       51237
  5       45576
  </code></pre>
  
  <p>I want to merge partition 2 and 3 but I am unable to decide which range I should give in merge function. </p>