Getting error in importing data from excel to Sql using Import Export Wizard

  • I got a list of zipcodes in excel that I need to import in Sql Server 2005. So, I have a file with dealerId and their zipcodes.

    Sample:

    DealerId Zips

    12345 99991, 99992, 99993, 99994, 99995

    When I tried to import this list, I got an error.

    Error 0xc020901c: Data Flow Task: There was an error with output column "ZipCodes" (30) on output "Excel Source Output" (9). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.".

    (SQL Server Import and Export Wizard)

    Upon doing some research, I found some of the zips for a dealer have been entered in this way in excel.

    DealerId Zips

    2154 99913, 99924, 99991, 99954, 99854, 99965, (line break)

    98454, 45412, 45412, 54565, 45845, 56585, 54125

    There are many more like this. Is there any way to get this to Sql. No matter what I set the destination Zipcode datatype to either varchar(MAX) or nvarchar(MAX) or text, it fails everytime with the same error.

    Please help!

  • bladerunner148 (8/19/2009)


    I got a list of zipcodes in excel that I need to import in Sql Server 2005. So, I have a file with dealerId and their zipcodes.

    Sample:

    DealerId Zips

    12345 99991, 99992, 99993, 99994, 99995

    When I tried to import this list, I got an error.

    Error 0xc020901c: Data Flow Task: There was an error with output column "ZipCodes" (30) on output "Excel Source Output" (9). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.".

    (SQL Server Import and Export Wizard)

    Upon doing some research, I found some of the zips for a dealer have been entered in this way in excel.

    DealerId Zips

    2154 99913, 99924, 99991, 99954, 99854, 99965, (line break)

    98454, 45412, 45412, 54565, 45845, 56585, 54125

    There are many more like this. Is there any way to get this to Sql. No matter what I set the destination Zipcode datatype to either varchar(MAX) or nvarchar(MAX) or text, it fails everytime with the same error.

    Please help!

    To be honest, the normal practise is to fix the input data, can you reformat the columns in excel. that would be the easiest solution.

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

  • Hi SilverFox,

    Do I have to do that manually or is there a way to do this in excel?

    Thanks!

  • I looked at this forum :

    and did the same. First imported the data to access and then imported to Sql. This time it worked but still there is a problem. Some of the dealers have so many zipcodes, not all of them are coming to Access database. One row is like

    12345, 12222, 24542, 23122, 54122, 26521, 26541, 26552, 24125, 12541, 26554, 21441, 21452, 12541, 122

    where there are few more zips after that. While importing the data from excel to access, i changed the datatype of zips to Memo but still the same issue. Is that a problem with excel or access? Do I need to choose a different datatype for the desitnation table?

  • Duh! I didn't look at the data closely after I changed the datatype to memo in access. All the zips are coming in now and I successfully imported that data to Sql from Access.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply