CSV import problem with Money data-type
-
I am following this article to import data from CSV file into my database table: http://www.codeproject.com/aspnet/ImportExportCSV.asp[^] The problem I am facing is that one of my table contains a money data-type column. Therefore, my application gives me Conversion error. When I try to import data from csv file into this table, I get: Disallowed implicit conversion from data type varchar to data type money, table 'MyTable', column 'Total'. Use the CONVERT function to run this query. The above article that I am following, puts all the data values from the csv file into quotes, such as: Insert into MyTable...... Values ('value 1','23.34'...). Thus SQL cannot convert 23.34 into money. Any way to solve this problem? Thanks
-
I am following this article to import data from CSV file into my database table: http://www.codeproject.com/aspnet/ImportExportCSV.asp[^] The problem I am facing is that one of my table contains a money data-type column. Therefore, my application gives me Conversion error. When I try to import data from csv file into this table, I get: Disallowed implicit conversion from data type varchar to data type money, table 'MyTable', column 'Total'. Use the CONVERT function to run this query. The above article that I am following, puts all the data values from the csv file into quotes, such as: Insert into MyTable...... Values ('value 1','23.34'...). Thus SQL cannot convert 23.34 into money. Any way to solve this problem? Thanks
If you are having a problem with a specific article, you should contact the article author. However, from the way you've described the problem the article isn't all that great because it looks like there is the opportunity for SQL Injection Attacks to take place via the CSV file.
*** Developer Day 4 in Reading, England on 2nd December 2006 - Registration Now Open *** Upcoming Scottish Developers events: * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog