Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Null data type
Message
De
06/03/2003 15:17:06
 
 
À
06/03/2003 12:21:24
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Divers
Thread ID:
00761393
Message ID:
00762411
Vues:
19
If you're using FK constraints, you will not be able to have an FK of 0 unless there is actually a row with an ID of 0 in the parent table. OTOH, you can have a FK of NULL.

-Mike

>>>>Hi all,
>>>>
>>>>What is the advantage when we allowing Null data type to each data field?
>>>>
>>>Aston,
>>>
>>>Null's are usefull when value in a field can be unknown. It mostly used with datetime data type to represent unknown or not entered yet value. I tend to use them only if I've to because they can be a pain to work with.
>>
>>
>>They also require some extra overhead in processing. So I recommend that you only use them if needed.
>
>Eric.
>If the Key fields are Ints, is there a problem getting reliable result sets when zeroes are in the foreign key fields rather than Nulls? Are Nulls treated differently than Zeroes? If you don't allow Nulls in your foreign key field then zero would seem like the natural "empty" value for a link. We are having a debate on this right now. Programatically it seems easier to deal with Zeroes than Nulls, but SQL result sets don't seem as reliable. Any input you, or Sergey, or anyone else could give me would be greatly appreciated.
>
>Regards,
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