Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

DTS to import Data from excel Expand / Collapse
Author
Message
Posted Tuesday, February 19, 2013 2:44 PM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, October 23, 2014 2:26 PM
Points: 752, Visits: 1,071
Hi,

I have one excel that has data like this:

ADM14021360066,208930705 502151 Abraçadeiras Plasticas Wurth 280x4,8 UN 1000.1 NOVO 200 Camião
ADM14021360066,208930706 502161 Abraçadeiras Plasticas Wurth 360x4,8 UN 1000.1 NOVO 300 Camião
ADM14021360066,208930707 2 Barra Reparação Magnum UN 1000.1 NOVO 2 Camião
ADM14021360066,208930708 3 Bicos Cola UN 1000.1 NOVO 70 Camião
ADM14021360066,208930709 4 Bidon Limpeza Travões Wurth 20Lt UN 1000.1 NOVO 1 Camião
ADM14021360066,208930710 7 Clip Autocolante UN 1000.1 NOVO 64 Camião
ADM14021360066,208930711 147334 Cola Fernador Azul Berner UN 1000.1 NOVO 1 Camião
ADM14021360066,208930712 147321 Cola Fernador Verde Berner UN 1000.1 NOVO 1 Camião
ADM14021360066,208930713 89309 Cola Klebfix Wurth UN 1000.1 NOVO 2 Camião
ADM14021360066,208930714 81 Cola Loctite Preta UN 1000.1 NOVO 1 Camião
ADM14021360066,208930715 0893449f Cola Metal Liquido Wurth1 UN 1000.1 NOVO 1 Camião
ADM14021360066,208930716 4242 Cola Past-o-Fix Berner UN 1000.1 NOVO 0 Camião
ADM14021360066,208930717 8963092f Cola Plastofix Wurth UN 1000.1 NOVO 2 Camiã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





Post #1421860
Posted Wednesday, February 20, 2013 1:37 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:51 AM
Points: 5,446, Visits: 7,616
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 | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1421972
Posted Wednesday, February 20, 2013 3:20 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, October 23, 2014 2:26 PM
Points: 752, Visits: 1,071
Dear Craig,

Thanks.

I have converted the file to CSV and it works.

Post #1422006
Posted Wednesday, February 20, 2013 10:35 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:51 AM
Points: 5,446, Visits: 7,616
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 | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1422203
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse