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 |