SSIS package ignores the decimal points value

Background: I am importing data from a csv file to SQL Server. Some of the columns in the csv file are obviously of the decimal data type and look like 123,12.

Problem: I wrote a SSIS package to import the data, everything imports without error, but the data in the table does not contain anything but 00 after the decimal point. So, instead of 123.12, in my SQL Server table I get 123.00.

Solution: The computer / server interprets the decimal value separator depending on the regional settings. In other words, if the computer has regional settings for English, then by default the decimal separator is (.). If the regional settings are for Swedish, then the regional separator is (,). And if you try to import data where the decimal separator is (,) to a server with regional settings for decimal separator (.), then SQL Server will ignore the decimal values.

The worst part is that there will be no error thrown.

To adjust your regional settings or the decimal separator you will have to go to Control Panel, then to Region and Language, and then to Advanced.In this screen, you can adjust the Decimal symbol.




Comments are closed.