General information
Forum:
Microsoft SQL Server
So you want to have a field that allows nulls but all non null values should be unique? Is this correct?
If so then you cannot use a primary or unique constraint, as David suggests add a check constraint on the field to ensure its uniqueness. You could also, if you want, do this validation through a trigger but the Check constraint would be the best way to do this.
Jon
>ok thnx jon,
>
>problem is that i can have multiple null values for that field in my file but only one true value (not null). Do you know another way to force an unique value in a record but allowing multiple null values ?
>
>thnx
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only