title: Sql Server Column with Auto-Generated Data
body: <p>I have a customer table, and my requirement is to add a new varchar column that automatically obtains a random unique value each time a new customer is created. </p>
  
  <p>I thought of writing an SP that randomizes a string, then check and re-generate if the string already exists. But to integrate the SP into the customer record creation process would require transactional SQL stuff at code level, which I'd like to avoid. </p>
  
  <p>Help please?</p>
  
  <p>edit:
  I should've emphasized, the varchar has to be 5 characters long with numeric values between 1000 and 99999, and if the number is less than 10000, pad 0 on the left. </p>