473,386 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Loading text files using DTS

We tried to load a file that contained 1 column of datetimes of the format
yyyy-MM-dd hh:mm:ss into a table that had the column set as a datetime type.
We did this using a DTS package. The error from DTS is attached. There seems
to be strange characters hidden in the file because a visual scan of all the data yielded
that they were all of valid datetime format. The files were transfered from a UNIX machine
to Windows via FTP. The file is ~107000 lines long. The 1st corrupt record could be
thousands of lines down. i.e. never the 1st record in the text file. We tried to set the
Row delimiter in the Text File Properties to {LF} instead of {CR}{LF} and that did not
work. We also tried to use a semicolon delimiter and that did not work either.
We tried both asc and bin methods of transfer in FTP and neither worked.
If someone has encountered this problem bofore, any help would be much appreciated.

Regards,
Mike Husler

************************************************** **************************************************

Execution Started: 4/14/2004 11:23:11 AM
Error during Transformation 'DTSTransformation__1' for Row number 1. Errors encountered so far in this task: 1.\0\0

Error Source: Microsoft Data Transformation Services (DTS) Data Pump
Error Description:TransformDateTimeString 'DTSTransformation__1', column pair 1 (source column 'Col001' (DBTYPE_STR), destination column 'time_tag' (DBTYPE_DBTIMESTAMP)): Cannot parse input data string beginning at '00:08'
Error Help File:sqldts80.hlp
Error Help Context ID:31231
\0\03003-05-21 13:00:08|

Execution Completed: 4/14/2004 11:23:11 AM

************************************************** **************************************************

Jul 20 '05 #1
1 4879
From the error it looks like SQL Server could not explicitly CAST the String
(DBTYPE_STR) datatype value in your source to your DateTime
(DBTYPE_DBTIMESTAMP). I dislike going straight from Text file to DB table
and usually stage the data in a working table first. You can then run TSQL
over the top to do some scrubbing.

You could on your DataPump set the Fetch and commit sizes to 1 and set your
allowable errors count to number > lines in your file (9999 is the GUI max
so you will need to do this in code if you want more)

If using 2000 you can log errors to a text file (last tab of the datapump)

If time is not important for your destination then here is a way of doing
things also

Formatting Character Data into Datetime fields
(http://www.sqldts.com/default.aspx?249)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Mike Husler" <Mi**************@noaa.gov> wrote in message
news:40**************@noaa.gov...
We tried to load a file that contained 1 column of datetimes of the format
yyyy-MM-dd hh:mm:ss into a table that had the column set as a datetime type. We did this using a DTS package. The error from DTS is attached. There seems to be strange characters hidden in the file because a visual scan of all the data yielded that they were all of valid datetime format. The files were transfered from a UNIX machine to Windows via FTP. The file is ~107000 lines long. The 1st corrupt record could be thousands of lines down. i.e. never the 1st record in the text file. We tried to set the Row delimiter in the Text File Properties to {LF} instead of {CR}{LF} and that did not work. We also tried to use a semicolon delimiter and that did not work either. We tried both asc and bin methods of transfer in FTP and neither worked.
If someone has encountered this problem bofore, any help would be much appreciated.
Regards,
Mike Husler

----------------------------------------------------------------------------
----
************************************************** **************************
************************

Execution Started: 4/14/2004 11:23:11 AM
Error during Transformation 'DTSTransformation__1' for Row number 1. Errors
encountered so far in this task: 1.

Error Source: Microsoft Data Transformation Services (DTS) Data Pump
Error Description:TransformDateTimeString 'DTSTransformation__1', column
pair 1 (source column 'Col001' (DBTYPE_STR), destination column 'time_tag'
(DBTYPE_DBTIMESTAMP)): Cannot parse input data string beginning at '00:08'
Error Help File:sqldts80.hlp
Error Help Context ID:31231
3003-05-21 13:00:08|

Execution Completed: 4/14/2004 11:23:11 AM

************************************************** **************************
************************
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike Husler | last post by:
We tried to load a file that contained 1 column of datetimes of the format yyyy-MM-dd hh:mm:ss into a table that had the column set as a datetime type. We did this using a DTS package. The error...
0
by: Marshal Antony | last post by:
Hi, I have a web service creates a # delimited text file on a server different than the web server per day for tracking databse transactions.All transactions will be writing to this same text...
1
by: BARTKO, Zoltan | last post by:
Hello folks, I have the following problem: I have a bunch of text files, I want to load them into a table where each file will be stored in one row. Question 1: Is there any way how to do...
1
by: svijay | last post by:
hi I have got a strange problem. May I know any solution for this. Here is the detailed description about the problem We have got a mainframe system and also production and development...
3
by: peterhinett | last post by:
I'm trying to add add text files to a listbox. I have got the directory box to come up but then when I click add it adds the whole file like d:/ readings.txt but I want it to display all the...
0
Dököll
by: Dököll | last post by:
Continued from: http://www.thescripts.com/forum/thread762010.html -VB 6.0 Professional -Microsoft DAO 3.6 Reference Search Database table... An attempt to fetch data housed in Access:
2
by: tensto | last post by:
Hi, I am running MS Access 2003 on an XP machine. I have developed a database which have some of the tables fields in a language different than English (Eastern Europe one, Polish and others),...
8
by: James From Canb | last post by:
Is there a way to open very large text files in VBA? I wrote some code in VBA under Excel 2003 to read database extracts, add the field names as the first line, and to convert the fixed length...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.