Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a constraint
Message
From
03/11/2005 13:16:13
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
 
 
To
03/11/2005 05:21:20
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
01064857
Message ID:
01065077
Views:
17
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
Map
View

Click here to load this message in the networking platform