SQL Int to Decimal Data Type - Alter Table

By admin | October 3, 2008

I had a problem recently when some automatic updates were not processing due to the data needing more decimal places.

I found a solution to change a field data type from Int to Decimal you can try this:

Alter table yourtable_
Alter Column yourtable_number Decimal(10,2)

The 2 numbers inside the brackets represent total 10 digits and in which 2 are after the decimal.

Eg yourtable_number data 3412 becomes 3412.00

  • Share/Save/Bookmark

Topics: SQL |

One Response to “SQL Int to Decimal Data Type - Alter Table”

  1. Poppy Alexander Says:
    January 20th, 2009 at 7:59 pm

    cheers, just what I needed

Comments