I am reading from one db table and writing same data to another db table.
Now if the date fields in the source do not have any data (null) then when it gets written to the destination table – the same fields get defaulted to a date “1/1/1900”.
I have not set this default value anywhere in my program. Not sure why it is happening.
Any idea how can I prevent that instead of checking each field for null values and setting it to a different value?
I am using Eclipse and SQL Server database.
Thanks.
One possibility is that the default value for the date columns are actually set to ‘1/1/1900’. If so , remove this default using SQLs ALTER TABLE. Syntax for SQL Server is:
Update: As it looks like this date is the out-of-the-box default, try setting:
Some important notes here: