>Hi, > >I have a field in a table USER_ID CHR(20) which has to be unique for every record. I thought that if I default the value of this field to Null (make it Nullable) it would solve the problem where no value is assigned by user into this field. But SQL Server considers NULL a valid value and gives me "The duplicate key value is (NULL)". Does it mean that my only option to enforce this rule is in code? (Actually the code is VFP so it is not difficult but I want to know if there is another option). >TIA.
If you're using SQL Server 2008 and up, you may want to go with the filtered index.