Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a constraint
Message
From
06/11/2005 09:27:12
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
 
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
01064857
Message ID:
01065833
Views:
17
Ok I get it, I'm always a bit slow off the mark..

Jon


>Jon,
>
>I think he's wanting to check that the value is either null or a single other value. So the set of possible values is something like: ( null, 'fred' )
>
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform