Solved

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

Posted on 2012-12-22
3
746 Views
Last Modified: 2012-12-23
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?
0
Comment
Question by:ndornack
3 Comments
 
LVL 42

Accepted Solution

by:
EugeneZ earned 250 total points
Comment Utility
try:

ALTER TABLE YourTable
ADD CONSTRAINT [DefaultConstraintDT]  DEFAULT ('1900-01-01') FOR [YourColumn_CreateDate]
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 total points
Comment Utility
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
 

Author Closing Comment

by:ndornack
Comment Utility
Thanks for the help, these both work.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now