INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Importing csv file error

Importing csv file error

(OP)
Hi

I am trying to import data from simple CSV file but keep getting these error messages on the OLE DB destinattion

Warning 1 Validation warning. Data Flow Task: OLE DB Destination [47]: Truncation may occur due to inserting data from data flow column "Column 4" with a length of 10 to database column "MaritalStatus" with a length of 1. Package.dtsx 0 0
Warning 2 Validation warning. Data Flow Task: OLE DB Destination [47]: Truncation may occur due to inserting data from data flow column "Column 5" with a length of 10 to database column "Gender" with a length of 1. Package.dtsx 0 0


I have tried to change the column sizes but keep getting the same error message. Any ideas what it can be and how I get it to work please

Thanks

RE: Importing csv file error

(OP)
Hi

I managed to get rid of the errors but I am now just getting a red box for my OLE DB destination, but it does not say why, is there a way to see what is incorrect.

Thanks

RE: Importing csv file error

(OP)
Nope back to square 1 same error, I just cannot work it out, why it is doing this, I have tried changing the column siz in both the SSI and the databse itself, but still the same issue.

Warning 1 Validation warning. Data Flow Task: OLE DB Destination [47]: Truncation may occur due to inserting data from data flow column "Column 4" with a length of 10 to database column "MaritalStatus" with a length of 1. Package.dtsx 0 0

Any ideas please, my database is crated from this SQL script.

CREATE TABLE [EmployeeImported](
[EmployeeID] [int] IDENTITY(1,1) NOT NULL,
[ContactID] [int] NOT NULL,
[ManagerID] [int] NULL,
[Title] [varchar](100) NOT NULL,
[MaritalStatus] [char](1) NOT NULL,
[Gender] [char](1) NOT NULL,
[HireDate] [datetime] NOT NULL
) ON [PRIMARY]
GO


Thanks

RE: Importing csv file error

Not sure this will help, but give it a try. This assumes that column 4 in the flat file will only have one character.

Right-click and edit your source file in the Connection Managers. Select the "Advanced" topic in the left pane. In the middle pane, select column 4. In the right pane, change the OutputColumnWidth property to 1. That should make the size of the incoming data match the table's column size.

RE: Importing csv file error

Your CREATE TABLE is still showing MaritialStatus as being CHAR(1). Make it CHAR(10). Also check your data in the spreadsheet for column 5. That should be Gender and it looks like you have something longer than one character there.

Your choices are to make the columns in the table longer or check the data in the spreadsheet to see why it is 10 characters long. Are there spaces? Maybe the column format for both is causing the issue.

Last choice is you could expand the length of the columns in the table, import the data and then see if there is any unusual data in the columns...if not, change them back to CHAR(1).

But without seeing your spreadsheet and the data, this is gonna be tough if not impossible for us to figure out.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875: What should I know before I post?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close