title: SQL Server : unique default values
body: <p>I have a table with a column of type <code>nchar(16)</code> that is automatically filled with random characters generated by setting the default value of the column to <code>dbo.randomtext((16))</code> (a scalar function). There will be about 1M records in the table.</p>
  <p>I know that the likelihood of getting non-unique values is low, but is there some way to ensure that this does not happen and the column is really unique?</p>
  <p>What will happen if I define the column as <code>UNIQUE</code> and the random text generated is not unique?</p>
  <p>I am using SQL Server 2016 Standard edition.</p>