Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null data type
Message
From
06/03/2003 15:17:06
 
 
To
06/03/2003 12:21:24
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Miscellaneous
Thread ID:
00761393
Message ID:
00762411
Views:
20
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform