Advertisement

04.25.2008 at 01:25PM PDT, ID: 23354858
[x]
Attachment Details

Problem importing date from string in flat file into SQL Server 2005 table using SSIS

Asked by Laura_Nash in SQL Server 2005, MS SQL Server

Tags: Microsoft, SQL Server Integration Services, 2005, Status value 2. The value could not be converted because of a potential loss of data

Hi

I've got a really irritating problem that I just can't seem to trace.  I'm new to SSIS, as we've just moved from SQL 2000 to 2005.

I have a pipe-deliminated flat file I want to import into a table in SQL Server 2005,  It's mostly a straight import, but there are two date files I need to convert to DateTime.  The fields have a simple yyyymmddhhmmss layout (i.e. 20080201153000 is 3:30pm on 1st Jan 2007).  The seconds are always blank so they can be left out if it helps.  I've set up an import and output and data converter, which is trying to convert the string to a DateTimeStamp.  I've also put in a calculated column to try changing the structure of the strings about before the conversion, but it doesn't seem to matter what layout I put it in I still get the same error:

Status value 2.  The value could not be converted because of a potential loss of data

Is there some way I can set the structure of a date string for a specific SSIS package? (I can't change the locale settings etc on the database).  Alternatively is there any layout of string that will import whatever the locale settings?  I've tried yyyymmdd hh:mm:ss and yyyyddmmhhmmss and yyyy/mm/dd hh:mm:ss.

Thanks
LauraStart Free Trial
[+][-]04.26.2008 at 03:18AM PDT, ID: 21445073

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, MS SQL Server
Tags: Microsoft, SQL Server Integration Services, 2005, Status value 2. The value could not be converted because of a potential loss of data
Sign Up Now!
Solution Provided By: mark_wills
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.26.2008 at 06:43AM PDT, ID: 21445500

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 07:24AM PDT, ID: 21445632

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628