title: CONTAINED IN (@start, @end) VS BETWEEN - temporal tables
body: <p><strong>Temporal Tables</strong> is a new feature in <code>SQL Server 2016</code> and above , it is like an interesting way for <code>SQL Server</code> to automatically keep history of data in a table, However there are some new T-SQL syntax introduced in <code>SQL Server 2016</code> to support Temporal Tables. I faced misunderstanding of some of them.</p>
  
  <p>From <a href="https://docs.microsoft.com/en-us/sql/relational-databases/tables/temporal-tables?view=sql-server-2017" rel="nofollow noreferrer">official documentation</a> the description of <code>BETWEEN &lt;start_date_time&gt; AND &lt;end_date_time&gt;</code> is as next:</p>
  
  <blockquote>
    <p>Same as above in the FOR SYSTEM_TIME FROM  TO
      description, except the table of rows returned
    includes rows that became active on the upper boundary defined by the
     endpoint.</p>
  </blockquote>
  
  <p>and the description of <code>CONTAINED IN (&lt;start_date_time&gt;, &lt;end_date_time&gt;)</code> is as next:-</p>
  
  <blockquote>
    <p>Returns a table with the values for all row versions that were opened
    and closed within the specified time range defined by the two datetime
    values for the CONTAINED IN argument. Rows that became active exactly
    on the lower boundary or ceased being active exactly on the upper
    boundary are included.</p>
  </blockquote>
  
  <p>so I understood, the only Different between <code>CONTAINED IN (@start,@end)</code> and <code>BETWEEN</code> clause is the <code>CONTAINED IN (@start, @end)</code> is including the @start boundary and <code>BETWEEN</code> clause is not. Am I right?</p>