How do I import a file to a SQL Server table with dates before 1970?

Tags:
SQL Server 2005
SSIS
I have a package created in SQL Server Integration Services (SSIS) to load data from three flat files to a table in SQL Server 2005. I use the loop to go through the folder. I need to make sure that I don’t insert rows where a date column includes a year before 1970 (the epoch). I'm really new to this. Could you give me an example on how to do this?

Answer Wiki

Thanks. We'll let you know when a new response is added.

The easiest way to do this would be to load all the data into a staging table, then delete any data which is before 1970 and then move the data into the production table.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Denny Cherry
    Check out my SQL Server blog "SQL Server with Mr Denny" for more SQL Server information.
    66,010 pointsBadges:
    report
  • Joyful
    A staging table would be perfect except we have limited space on the server. The file has approx. 100 million + records. Is there any way this could be done without using a staging table. Thanks for any help. joyful
    10 pointsBadges:
    report
  • Wdi
    why not inserting a trigger on the date field? (which rejects dates before 1970)
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following