Link to home
Start Free TrialLog in
Avatar of robrodp
robrodpFlag for Mexico

asked on

ms sql 2005 error when importing data

I am using the import manager from ms sql 2005
I am importing from a tab delimited flat table
I set colums with legnth to fit all data (just characters)
I start the process and get this error:

Information 0x402090de: Data Flow Task: The total number of data rows processed for file "I:\consultores\BASES DE DATOS\faltantab.txt" is 35.
 (SQL Server Import and Export Wizard)
 
Error 0xc02020c5: Data Flow Task: Data conversion failed while converting column "Nombre" (10) to column "Nombre" (63).  The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
 (SQL Server Import and Export Wizard)
 
Error 0xc0209029: Data Flow Task: The "output column "Nombre" (63)" failed because error code 0xC020907F occurred, and the error row disposition on "output column "Nombre" (63)" specifies failure on error. An error occurred on the specified object of the specified component.
 (SQL Server Import and Export Wizard)
SOLUTION
Avatar of James Murrell
James Murrell
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, that's right and and is a right pain that a flat file will default to 50, and then (if no table) defaults to nvarchar 50. The error resolution is very subtle as to which one is the offending column often resulting in resetting both - and if some mapping has happened, also means remove the table (or entries) and starting again... That is part of the reasoning behind the staging table - it is sooo much easier to manage the database space...

Of course you do not have to use the wizard, there are other more robust ways of handling it - but only if you are good with coded solutions, otherwise the wizard is a right pain in the proverbial, but very easy to use. Pro's and Con's. At the end of the day, you do end up with a robust solution either way, so long as there are no changes, and, if you were to sit down and plan the project to it's fullest extent then you would probably have the import layout document sitting beside you when defining the import file definition. Reality, we all tend to dive in, and then find out about the 50 characters after wards...

Cheers,