How do I import a file to a SQL Server table with dates before 1970?
0
Q:
How do I import a file to a SQL Server table with dates before 1970?
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?
ASKED: Mar 21 2008  9:12 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
46795 pts.
0
A:
 RATE THIS ANSWER
-1
Click to Vote:
  •   0
  •  -1
  • AddThis Social Bookmark Button
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.
Last Answered: Mar 22 2008  0:04 AM GMT by Mrdenny   46795 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Mrdenny   46795 pts.  |   Mar 22 2008  12:08AM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 

Joyful   10 pts.  |   Mar 24 2008  5:53PM GMT

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

 

Wdi   10 pts.  |   Apr 2 2008  7:59PM GMT

why not inserting a trigger on the date field? (which rejects dates before 1970)

 
0