I am working on an SQL Database, I have a column named "Price". When the database was created the column "Price" was set to
You don't need to add a new column two times, just remove the old one after updating the new one:
ALTER TABLE table_name ADD new_column_name decimal(18,2) update table_name set new_column_name = convert(decimal(18,2), old_column_name) ALTER TABLE table_name DROP COLUMN old_column_name
Note that if the
old_column_name is not numeric, the
convert may fail.