title: (TSQL) unique index on nvarchar(200) sparse null column
body: <p>I'm facing a confusing problem. If you create a table like the following, you'll get an error:</p>
  
  <pre><code>CREATE TABLE t
  (
   a NVARCHAR(100) SPARSE
                   NULL UNIQUE
  )
  
  Msg 1919, Level 16, State 2, Line 1
  Column 'a' in table 't' is of a type that is invalid for use as a key column in an index.
  Msg 1750, Level 16, State 0, Line 1
  Could not create constraint. See previous errors.
  </code></pre>
  
  <p>But if you create the table first, then create the unique index like this, everything works.</p>
  
  <pre><code>CREATE TABLE t
  (
  
   a NVARCHAR(100) SPARSE
                   NULL
  )
  
  CREATE UNIQUE NONCLUSTERED INDEX t_a ON dbo.t
  (
  a
  )
  </code></pre>
  
  <p>Anyone can help me to explain it please?</p>
  
  <p>Thank you!</p>