Problem while importing data to Microsoft Sql Server 2005 from .csv file
-
I want to import data to Microsoft Sql Server 2005 from .csv file In .csv file I am having a column which has numeric data . During the import process I am receiving data conversion error. In case I used this column as string then it works, but I want column as numeric. Kindly tell if I am missing something. Thanks in Advanced.
-
I want to import data to Microsoft Sql Server 2005 from .csv file In .csv file I am having a column which has numeric data . During the import process I am receiving data conversion error. In case I used this column as string then it works, but I want column as numeric. Kindly tell if I am missing something. Thanks in Advanced.
a_b111 wrote:
which has numeric data . During the import process I am receiving data conversion error
Either you have a non-numeric value, or your numeric data type does not match that of your file. Check all your values against your data types.
Bob Ashfield Consultants Ltd
-
I want to import data to Microsoft Sql Server 2005 from .csv file In .csv file I am having a column which has numeric data . During the import process I am receiving data conversion error. In case I used this column as string then it works, but I want column as numeric. Kindly tell if I am missing something. Thanks in Advanced.
As Bob said - data types, probably a blank cell that is treated as "". I always import into a staging table of varchars and use a stored proc to do the transforms AFTER loading the data. Dates will also screw you with weird formats.
Never underestimate the power of human stupidity RAH
-
As Bob said - data types, probably a blank cell that is treated as "". I always import into a staging table of varchars and use a stored proc to do the transforms AFTER loading the data. Dates will also screw you with weird formats.
Never underestimate the power of human stupidity RAH
-
I have tried to import into a staging table of varchar and use a query to do the transforms AFTER loading the data, but it failed. Please tell me the stored procedure to do the transforms AFTER loading the data.
a_b111 wrote:
Please tell me the stored procedure to do the transforms AFTER loading the data.
You have to write it, in your OP you said you could get it to work using string - varchar so that part should work. Now you have the data in front of you and you know where it has to go - so write the procedure to do the work. This removes the LOAD from the potential problems you can have, now all you need to do is transform the data into your tables.
Never underestimate the power of human stupidity RAH
-
I want to import data to Microsoft Sql Server 2005 from .csv file In .csv file I am having a column which has numeric data . During the import process I am receiving data conversion error. In case I used this column as string then it works, but I want column as numeric. Kindly tell if I am missing something. Thanks in Advanced.
a_b111 wrote:
Kindly tell if I am missing something.
Yes. :cool: