Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Blank Dates From .CSV

Status
Not open for further replies.

Devilboy916

Programmer
Nov 10, 2005
4
GB
Hi everyone

I am trying to import a .csv file into a SQL table using DTS.
In this file is a date field with null values.
This is correct data, but when I run the DTS, an error returns saying it cant put text values into a date field.

I have 'allow nulls' ticked on the date field in SQL.

i cant think of what it could be!

Anyone?
Cheers
 
Hi Devilboy916,

When importing from a CSV data source file, DTS assigns a varchar/nvarchar datatype for each column in the CSV file.

You could use a "staging" table in MSSQL to import all the Source CSV data, and then use a Transform Data Task to load data into the Destination table.

In the Transform Data Task set the transformations for each column to your requirement using ActiveX scripts, essentially VBScript, so any VB/VBA data-type conversion function can be used.


HTH,
DataLWalker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top