DTS to import Data from excel

  • Hi,

    I have one excel that has data like this:

    ADM14021360066,208930705502151Abraçadeiras Plasticas Wurth 280x4,8UN1000.1NOVO200Camião

    ADM14021360066,208930706502161Abraçadeiras Plasticas Wurth 360x4,8UN1000.1NOVO300Camião

    ADM14021360066,2089307072Barra Reparação MagnumUN1000.1NOVO2Camião

    ADM14021360066,2089307083Bicos ColaUN1000.1NOVO70Camião

    ADM14021360066,2089307094Bidon Limpeza Travões Wurth 20LtUN1000.1NOVO1Camião

    ADM14021360066,2089307107Clip AutocolanteUN1000.1NOVO64Camião

    ADM14021360066,208930711147334Cola Fernador Azul BernerUN1000.1NOVO1Camião

    ADM14021360066,208930712147321Cola Fernador Verde BernerUN1000.1NOVO1Camião

    ADM14021360066,20893071389309Cola Klebfix WurthUN1000.1NOVO2Camião

    ADM14021360066,20893071481Cola Loctite PretaUN1000.1NOVO1Camião

    ADM14021360066,2089307150893449fCola Metal Liquido Wurth1UN1000.1NOVO1Camião

    ADM14021360066,2089307164242Cola Past-o-Fix BernerUN1000.1NOVO0Camião

    ADM14021360066,2089307178963092fCola Plastofix WurthUN1000.1NOVO2Camião

    There are several values that are imported as null on column codigo.

    For instance, the code that is on excel as 8963092f is imported to the column codigo as null.

    Can someone explain why?

    thanks,

    Pedro

    P.S table code:

    CREATE TABLE [dbo].[table2] (

    [STSTAMP] [char] (25) COLLATE Latin1_General_CI_AS NULL ,

    [CODIGO] [varchar] (1000) COLLATE Latin1_General_CI_AS NULL ,

    [DESIGNACAO] [varchar] (1000) COLLATE Latin1_General_CI_AS NULL ,

    [UNIDADE] [varchar] (1000) COLLATE Latin1_General_CI_AS NULL ,

    [FAMILIA] [varchar] (1000) COLLATE Latin1_General_CI_AS NULL ,

    [ESTADO] [varchar] (1000) COLLATE Latin1_General_CI_AS NULL ,

    [QUANTIDADE] [varchar] (1000) COLLATE Latin1_General_CI_AS NULL ,

    [LOCALIZACAO] [varchar] (1000) COLLATE Latin1_General_CI_AS NULL

    ) ON [PRIMARY]

    GO

  • Excel importing is insanely fussy and nearly impossible to remotely troubleshoot, but I'll try a bit. What's the import designation for that field? VARCHAR(255) or VARCHAR(MAX)? Is it possibly int or something else?

    Must you import from excel or can you have your users save the files as CSVs? They can do that right from Excel when they're done fussing with the file.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • Dear Craig,

    Thanks.

    I have converted the file to CSV and it works.

  • Glad that the workaround is effective for you. Excel and its data drivers tend to be... aggravating to work with. Good luck! 🙂


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

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

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