• Nice question. However, you can actually run the code without the default on the dateofjoin column and get the exact same result for id 2. The blank space is causing the datetime column to default to 1/1/1900 instead of the default constraint on the column being applied. As Lokesh mentioned, a zero would cause the same behavior.

    create table #test(id int,EmpName varchar(50),dateofjoin datetime)

    insert into #test

    select 1,'malli',null

    union

    select 2,'reddy',' '

    union

    select 3,'test',getdate()

    select * from #test

    drop table #test

    /*--Results

    id EmpName dateofjoin

    ----------- ------------ -----------------------

    1 malli NULL

    2 reddy 1900-01-01 00:00:00.000

    3 test 2012-11-27 00:09:06.313

    */