i am inserting values like '$5.99
' (or trying to insert) into a money
field. it doesnt like the dollars sign
i am actually doing a bulk insert from a csv file. one of the columns in the csv file has money
in it with a dollar sign
can you please help me figure out how to do this bulk insert with the $
sign into a money
field?
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 2 (pricepaid).
how do i get rid of the sign?
Based on this question, as well as your earlier questions here and here, I'd recommend that you do your bulk insert into a temporary holding table, where you could define your "money" field as a varchar. Then write another SQL statement to move the data from the holding table to the real table. In this SQL statement, you could skip unwanted columns, remove the '$' from your "money" field and cast it as a money data type, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With