|
Could anyone explain me with suitable example , What is the difference between Null Data Types and Not Null Data Type ? Whenever we create any user defined data type it will ask whether you want to create null or not null data type. So my Concern here what it will create difference in both case. With Regards, Shalabh Saxena
(comments are locked)
|
|
The difference is just whether the type can hold a null value. If not specified, NULL is the default.
(comments are locked)
|
|
There is no NULL data type. Each of the data types (with a couple of exceptions) can be NULL. You can require a value, which means that you define that column for a given data type within a table as NOT NULL. Or, you can specify that a given column in the table allows NULL values, by setting it's definition using NULL. You just have to remember that NULL is just that, NULL. It doesn't have any meaning. It's not the same as an empty string, or zero, or an empty set, or even unknown. It's simply not there, NULL. Also a NULL value can't be compared to another value, even another NULL value. So you can't use = < > or any other comparison operator. Instead you have to use commands that take into account NULL logic such as ISNULL, IS NULL, IS NOT NULL.
(comments are locked)
|

