title: Creating index in SQL Server with ONLINE = ON if supported
body: <p>I'm creating an index in a SQL Server table with <code>ONLINE = ON</code> option:</p>
  
  <pre><code>CREATE INDEX IX_Name ON Users (Name) WITH ONLINE = ON
  </code></pre>
  
  <p>If this script is run on non-Enterprise SQL Server edition I get this error:</p>
  
  <blockquote>
    <p>Online index operations can only be performed in Enterprise edition of SQL Server.</p>
  </blockquote>
  
  <p>How to write a SQL script to use <code>ONLINE = ON</code> option on Enterprise editions and not to use it for non-supported editions?</p>