Sunday, February 19, 2012

allowing null values

I have a flat file that I'm reading from and loading my tables with. In that file I have a column that has numbers (2000,1999,1998 and so on) and the column that they are being loaded into is defined as an INT. The issue I'm running into is that the first 50 or so rows in the flat file is empty for this column so I'm getting an error message. If I put numbers in that column in the flat file it works, if i remove them it fails. How can I allow for NULL values for my INT column on the database table?

here is the error I'm getting:

[OLE DB Destination [182]] Error: There was an error with input column "SalesYear" (7259) on input "OLE DB Destination Input" (195). The column status returned was: "The value could not be converted because of a potential loss of data.".What is the format of the flat file?

CSV? Tab delimited? Fixed width?|||

I got it to work, I had to go into the flat file connection and make some changes there on the field. Once I did that it loads correctly.

|||

IGotyourdotnet wrote:

I got it to work, I had to go into the flat file connection and make some changes there on the field. Once I did that it loads correctly.

Can you share what kind of changes you made to perhaps help others down the road?

Thanks.|||

I just changed the data type of the column. So instead of creating a derived column for it, I just changed it in the flat file connection manager.

|||

I have a similar problem.Could you tell me what datatype you used in Flat file connection manager and the data type used in databse?|||

remsid wrote:

I have a similar problem.Could you tell me what datatype you used in Flat file connection manager and the data type used in databse?

Try a character data type.

No comments:

Post a Comment