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
asked May 20 '12 at 07:29 AM in Default
The difference is just whether the type can hold a null value. If not specified, NULL is the default.
answered May 21 '12 at 12:32 PM
Kev Riley ♦♦
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.
answered May 21 '12 at 01:19 PM
Grant Fritchey ♦♦