SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


truncation error but data types are the same


truncation error but data types are the same

Author
Message
aazzner
aazzner
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 30
Afternoon all,

I have a flat file .csv format that I am importing.
It is 53 columns across and when it hits column 3 it tells me that it can't process it, and everything after that column is null.
The column is the header row for the file and is a nvarchar(50) as is everything else for standardization purposes.
My error is:
Data conversion failed. The data conversion for column "Column 3" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

There is no text qualifier in this file, but I tried " anyway - no difference.
I set the error output to ignore the failure, and that is how I know everything is null after column 3.
The data rows come in just fine, but I am importing multiple files into one processing table, with possibly different headers, which is why I need the header row included with the data.

Anyone have any idea what is wrong with this thing?

I have spent 6 hours on it, and I am no closer to figuring it out.
I have asked for a new sample file to see if my test import file is corrupted somehow, but I haven't received it yet.

Thanks for all your assistance!!

Aazzner
aazzner
aazzner
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 30
Found the error.
It was in the data connection. The original input configuration thought the column was a float, and when it converted it to a unicode (50) it thought it was truncating.
All good!

So if anyone else is having this issue, go check your advanced column settings in your Flat File Connection Manager Editor and make sure they match Smile

Aazzner
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search