Solved

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

Posted on 2012-12-22
3
752 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 42

Accepted Solution

by:
Eugene Z earned 250 total points
ID: 38716460
try:

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

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 total points
ID: 38716882
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
ID: 38717436
Thanks for the help, these both work.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

749 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