SQL 2008 default date needs to be 1900-01-01

I am trying to set the "Default Value or Binding" to
1900-01-01

on SQL server 2008

I am getting the error:
Error Validating the default for column 'CreateDate'
Do you want to cancel your changes?

I don't want to use getdate() for my default.  How can I do this?
ndornackAsked:
Who is Participating?
 
Eugene ZConnect With a Mentor Commented:
try:

ALTER TABLE YourTable
ADD CONSTRAINT [DefaultConstraintDT]  DEFAULT ('1900-01-01') FOR [YourColumn_CreateDate]
0
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
you could also use '' as default value, evaluating as 1900-01-01 also...
the trick is to put the quotes, without the quotes it would be 1900 minus 1 minus 1 which will be 1898, which would evaluated to 1900-01-01 + 1898 days ...
0
 
ndornackAuthor Commented:
Thanks for the help, these both work.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.