473,786 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 'DTSTransformat ion__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:Tra nsformDateTimeS tring 'DTSTransformat ion__1', column pair 1 (source column 'Col001' (DBTYPE_STR), destination column 'time_tag' (DBTYPE_DBTIMES TAMP)): Cannot parse input data string beginning at '00:08'
Error Help File:sqldts80.h lp
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 4905
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_DBTIMES TAMP). 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 'DTSTransformat ion__1' for Row number 1. Errors
encountered so far in this task: 1.

Error Source: Microsoft Data Transformation Services (DTS) Data Pump
Error Description:Tra nsformDateTimeS tring 'DTSTransformat ion__1', column
pair 1 (source column 'Col001' (DBTYPE_STR), destination column 'time_tag'
(DBTYPE_DBTIMES TAMP)): Cannot parse input data string beginning at '00:08'
Error Help File:sqldts80.h lp
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
2408
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 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...
0
1766
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 file for the day.I was testing this web service written in C# from a web page, created 5 threads which create the file and 10 inserts to the same file total. But I got unpredictable results(not all records created,
1
1661
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 this in psql? AFAIK the \copy command interprets \n as a new line and so I can't get it
1
2411
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 server.
3
1748
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 readings within the file. This is my code so far. Private Sub btnload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnload.Click openFileDialog1.InitialDirectory = "d:\" openFileDialog1.RestoreDirectory...
0
13542
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
2756
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), i.e. an Unicode codepage is used as there're some specific non-English characters being used, for example in people's names. Here comes the tricky part -- I have written a piece of VBA code to export some tables/queries into a flat text files which...
8
17322
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 fields to tab delimited. This allowed the data to be imported into a data analysis tool. Easy so far. The problem came when I tried to open the larger files. The biggest is around 350GB. VBA gave an error. I've got a workaround by splitting the...
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10108
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4064
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.