Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constraint problem
Message
De
30/04/2004 12:20:19
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00899745
Message ID:
00899821
Vues:
18
A unique constraint will only allow one NULL value. If you must enable support for multiple nulls, you'll have to enforce the uniqueness using triggers.

>> It is possible to write a line in the header table without adding lines in the detail.

Yes. The FK constraint should be created on the Detail table.

-Mike

>Hello
>
>I've got the following problem:
>
>a header and detail table, the join between them is a field called cce_no. This field is not the primary key of the header table. It is possible to write a line in the header table without adding lines in the detail. At that moment cce_no contains the null value.
>Now I want to enforce data integrity between the two tables. To do so, I need to create an unique index on cce_no in the header table to enforce the constraint. When I try to do this, I get a 'duplicate key' error because of the null values in cce_no.
>How can I solve this problem ??
>
>Greetings,
>Hans
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform