Azure Data Studio does not properly import CSV

975 views Asked by At

Please would you help me out with this error.

I am trying to import a csv file through the wizard, downloaded here https://ourworldindata.org/covid-deaths.

But unfortunately it is not converting all floats.

enter image description here

Thank you in advance!

Tried cast the data type in a script after uploading a csv all float columns as all varchars, it uploaded and then I tried to change data types in a script manually. It still gives an error that it is impossible.

1

There are 1 answers

7
Bhavani On

I tried to replicate the issue in my environment. Downloaded the csv file from given link and tried to import the file into azure data studio. I got the same error:

enter image description here

While importing CSV files Azure data studio taking nvarchar(1) data type to the string columns by default. I changed the datatype to nvarchar(50) to the string columns and selected Allow Nulls values to all columns to insert including null data.

enter image description here

After above changes the data imported successfully into database.

enter image description here

While importing the once check the data types according to the data. Imported data table:

enter image description here