I have a table in which there is a field called UserName. This field is not the primary key but it needs to be a unique key. This value is often left as null.
I built a unique index on that field but I had to remove it because null values are seen as duplicates. Is there a way to enforce uniqueness only if the value is not null.