Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8374629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:57:51+00:00 2026-06-09T14:57:51+00:00

I am reading from one db table and writing same data to another db

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:57:52+00:00Added an answer on June 9, 2026 at 2:57 pm

    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:

    ALTER TABLE Table1 ALTER COLUMN DateColumn1 DROP DEFAULT
    

    Update: As it looks like this date is the out-of-the-box default, try setting:

    ALTER TABLE Table1 ALTER COLUMN DateColumn1 DATETIME NULL
    

    Some important notes here:

    1. Backup your database before you start altering tables(!)
    2. Use the the same datatype (e.g. DATETIME) in your ALTER command.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two threads, one reading streams and producing data-objects from their content. I
Are there any concurrency problems with one thread reading from one index of an
Hey all. I'm reading from one sql-format file to another, and two bytes in
I have a table of data in MS Access 2007. There are 6 fields
I am making one application where i am reading mails from Lotus Notes. I
Should be an easy one. I thought, from reading this blog post that I
If i am reading one of my application settings from the web.config everytime when
How I can start reading from a specific byte? I have following code: try
Ive been reading from several sources, and now Im more confused then ever. So
I am trying to using a SQL data reader to move records from one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.