Error while importing through wizzard a CSV file

Helen 20 Reputation points
2023-06-22T08:18:03.41+00:00

Hello!

I am having trouble while importing .csv file. It gives the same error. Please help me:

Why does it see all cell values as string ? All values in my cells are floats.

✗ Microsoft.SqlServer.Prose.Import.BcpProcessException: Error inserting data into table.
---> System.InvalidOperationException: The given value '0.0' of type String from the data source cannot be converted to type float for Column 5 [new_cases].
---> System.FormatException: Failed to convert parameter value from a String to a Double.
---> System.FormatException: The input string '0.0' was not in a correct format.

Azure SQL Database
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 41,491 Reputation points
    2023-06-23T06:15:42.88+00:00

    Hi @Helen

    Why does it see all cell values as string

    The data in csv file is text and does not have the format of float.

    You may try to use SSIS to load the csv to sql server table which will be more convenient.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2023-06-22T08:38:30.14+00:00

    Why does it see all cell values as string ? All values in my cells are floats.

    A CSV is a comma-separated-values text (!) file; everything is text until you define a different data type. In Wizard click on "Column mapping" and define different data types.


  2. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-06-22T21:26:09.0533333+00:00

    What are you regional settings? In many regional settings the decimal delimiter is the comma. I don't use the wizard a lot, but I don't think there is a way to set the delimiter. You may have to change your regional settings in order to import the file.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.