dbTalk Databases Forums  

Collation problem with bulk insert from text file

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Collation problem with bulk insert from text file in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Magnus
 
Posts: n/a

Default Collation problem with bulk insert from text file - 08-13-2003 , 04:40 AM






Hi
I am using bulk insert in a package to import data from a text file. I have
tried using both Bulk insert task and a t-sql query.
The text file contains data looks formatted like this:
158992;100
565666;52.6
565455;63
585115;39,5
554542;50

The tables in the database are int and float.
The problem is that the float column ignores the comma and the value "39,5"
becomes "395" instead.
I have tried many combinations of codepage and datafiletype.
The bulk insert statement looks like this:
bulk insert storeDB.dbo.ProductPrice
FROM 'C:\DATA_AS400\ProductPrice.txt'
With
(
FIELDTERMINATOR = ';'
,ROWTERMINATOR = '\n'
,FORMATFILE = 'C:\DATA_AS400\ProductPrice.fmt)

And the format file like this:
8.0
2
1 SQLINT 0 4 ";" 1 ProductID ""
2 SQLFLT8 0 8 "" 2 Price ""

Need help!
Magnus



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.