• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 910
  • Last Modified:

DTS Character Date into DateTime field

I am trying to import data into an SQL 2000 table that includes dates using DTS.  The import flat (text) file is fixed field delimited and fairly straight forward.  I attempt to import a 10 character date (MM/DD/YYYY) from a fixed position of the text file into a column of a SQL2K table defined as smalldatetime (or datetime, neither works).  When setting up the transformation in DTS and trying to map the column containing the date from the text file to the column in the SQL2K table I get the following message:

An error occurred when you tried to submit changes to this transform.  Please refer to the following error message and make sure that you have edited other properties of this transform by pressing "Properties" button under the "General" tab.
Error Source : Microsoft Data Transformation Services (DTS) Data Pump.

Error Description: DTSTransformCopy: Schema validation failed; see Extended Error information.
TransformCopy '(no name)' validation error: Source column too narrow to contain a valid value of the destination column's datatype for column pair 1 (source column 'Col013' (DBTYPE_STR), destination column 'ppp_date' (DBTYPE_DBTIMESTAMP).

My client is running SQL 2000 - SP2 (I believe).  Any thoughts on how to get this done without creating a temp column of CHAR(10) and updating the DateTime column with the temp column value ???
1 Solution
Try running it using a ActiveX Script, like this:

Function Main()
  If IsDate(DTSSource("Col013") Then
    DTSDestination("ppp_dt") = CDate(DTSSource("Col013"))
    Main = DTSTransformStat_OK
    Main = DTSTransformStat_Fail
  End If
End Function
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
No comment has been added to this question in more than 251 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: Frostbyte_Zero http:#8090699

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now