Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing csv file error

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
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
 
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
 
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
 
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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top