I imported an excel file into my database using Tasks -> Import -> Excel 2007
The rows in my excel file had values only upto three decimals places, but on importing them into the database, the data type float was given to columns and it now has 6 digits after decimal.
I want to display only upto 3 decimal places in my end user application. Any way I could restrict this to only three decimal places here in DB?
When you import you are able to ‘Edit mappings’ to choose a specific data type. On the dialog captioned ‘Select Source Tables and Views’ there is a button captioned ‘Edit Mapping…’ from where you should be able to change the data type e.g. from float to decimal and then set the specific precision and scale.
Note that Excel does’t have a fixed point decimal type — actually it doesn’t have an integer type either! — only float so I am not surprised that SQL Server doesn’t do much data type inference.