PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > Importing csv files
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Importing csv files

Réponse
 
LinkBack Outils de la discussion
Vieux 13/06/2008, 22h10   #1
tshad
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Importing csv files

I am using Sql Server 2005 and found a problem with importing csv files that
I don't believe happened in 2000.

If I am importing a .csv file, it will assume that I want to output char(50)
for every single field.

I understand that it doesn't know what the columns sizes (or types) are when
you first tell it which flat file to use. But then you tell it what the
output table is and it correctly shows you what the column types and lengths
are.

But it still trys to ouptut each fields as char(50), even in a datetime
field.

So it crashes.

You need to go back to where you told it what flat file you wanted, select
advanced from the left pane and then proceed to change all 40 columns (in my
case) to the correct sizes and types.

Is there a way to tell it to use the sizes and types it found in the table?

Then if the sizes were still too large - fine. Or give you an option to
truncate it.

Thanks,

Tom


  Réponse avec citation
Vieux 14/06/2008, 18h14   #2
John Bell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Importing csv files


"tshad" <tshad@dslextreme.com> wrote in message
news:O5pnBGZzIHA.1772@TK2MSFTNGP03.phx.gbl...
>I am using Sql Server 2005 and found a problem with importing csv files
>that I don't believe happened in 2000.
>
> If I am importing a .csv file, it will assume that I want to output
> char(50) for every single field.
>
> I understand that it doesn't know what the columns sizes (or types) are
> when you first tell it which flat file to use. But then you tell it what
> the output table is and it correctly shows you what the column types and
> lengths are.
>
> But it still trys to ouptut each fields as char(50), even in a datetime
> field.
>
> So it crashes.
>
> You need to go back to where you told it what flat file you wanted, select
> advanced from the left pane and then proceed to change all 40 columns (in
> my case) to the correct sizes and types.
>
> Is there a way to tell it to use the sizes and types it found in the
> table?
>
> Then if the sizes were still too large - fine. Or give you an option to
> truncate it.
>
> Thanks,
>
> Tom

Hi Tom

I don't have to re-specify column data types with the import wizard and
defaults to 50 characters only seem to occur if I don't specify an existing
table. Which version are you on?

Have you tried saving this as a SSIS package and just re-using that?

John

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 04h31.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09651 seconds with 10 queries