Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bulk insert cmd includes Double quotes in character stri
Message
De
04/04/2003 13:30:05
 
 
À
04/04/2003 05:03:18
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Import/Export
Divers
Thread ID:
00773913
Message ID:
00774151
Vues:
12
It's possible but not easy. You'll have to create a BCP style format file and include it in the call to BULK INSERT (FORMATFILE parameter). The file will have to be customized as described in this article: http://support.microsoft.com/default.aspx?scid=kb;EN-US;132463.

One trick I use - instead of creating a format file manually, I go to DTS Designer, create a Bulk Insert Task and have it create the format file for me. Once you have the format file generated, you can customize it as described in the KB article.

Roman


>Hi,
>
>I am impotring data from a txt files into an sql database using bulk insert command. Character fields are enclosed in "(double Quotes).
>After Importing The Data i see that the double quotes are also included in the fields.
>
>How Can i avoid this without using a format file?
>
>Here is an example of my bulk insert command :
>
>DECLARE @cPATH VARCHAR(200)
>SET DATEFORMAT dmy
>SET @cPATH= '"C:\Imdbcy\DBIMDB\output\Chrvalues.txt"'
>EXEC ('BULK INSERT IMDB..ChrValues FROM '+@cPATH+' WITH (CODEPAGE=''RAW'',DATAFILETYPE=''CHAR'', FIELDTERMINATOR = '','', ROWTERMINATOR =''\n'',KEEPIDENTITY)')
>
>
>Tnx
>Anthi
Roman Rehak, MCSD, MCDBA, MCSA
Competitive Computing
354 Mountain View Drive
Colchester, VT 05446-5824
802-764-1729
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform