dbTalk Databases Forums  

Transforming Text Data to a Smalldatetime Data Type

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Transforming Text Data to a Smalldatetime Data Type in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
trianbmt (AT) dfw (DOT) wa.gov
 
Posts: n/a

Default Transforming Text Data to a Smalldatetime Data Type - 04-28-2006 , 01:47 PM






I'm trying to move some data from a tab delimited text file into a SQL
Server 2000 database table using DTS and have run into a problem
converting text data into smalldatetime. The format for the dates in
the text file is CCYYMMDD, all text fields are double quoted.

I created the initial transform data task using the wizard and then
opened it up in the designer to make changes. I select the Transform
Data Task, then click on the Transformation tab and set Phases Filter
to Row Transform, Name to None Selected, Type to None Selected. Then I
click on the Delete All button to remove existing transformations, and
New to create the new transformation. I select DateTimeString, set the
properties for the source and destination formats, then select the
Source Columns and the Destination Columns and click OK. At this point
I get the following error message:

"Error Description: TransformDateTime String: Must have one source
column and one destination column, and each must be compatible with
datetime format."

I found that if I only select one date field from the source file and
one from the corresponding destination field in the database table, the
DTS job is happy and the transformation is created. It's when I try to
add the conversions for the other date fields and the remaining text
fields that the error message is generated.

Anyone have any idea what I'm doing wrong?


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Transforming Text Data to a Smalldatetime Data Type - 04-29-2006 , 08:35 AM






Hello trianbmt (AT) dfw (DOT) wa.gov,

Whenever I want to mave dates from a text file to SQL Server and they are
in this format I tend to always use this example

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


Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
I'm trying to move some data from a tab delimited text file into a SQL
Server 2000 database table using DTS and have run into a problem
converting text data into smalldatetime. The format for the dates in
the text file is CCYYMMDD, all text fields are double quoted.

I created the initial transform data task using the wizard and then
opened it up in the designer to make changes. I select the Transform
Data Task, then click on the Transformation tab and set Phases Filter
to Row Transform, Name to None Selected, Type to None Selected. Then
I click on the Delete All button to remove existing transformations,
and New to create the new transformation. I select DateTimeString,
set the properties for the source and destination formats, then select
the Source Columns and the Destination Columns and click OK. At this
point I get the following error message:

"Error Description: TransformDateTime String: Must have one source
column and one destination column, and each must be compatible with
datetime format."

I found that if I only select one date field from the source file and
one from the corresponding destination field in the database table,
the DTS job is happy and the transformation is created. It's when I
try to add the conversions for the other date fields and the remaining
text fields that the error message is generated.

Anyone have any idea what I'm doing wrong?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.