Sql-server – How to alter the precision of a decimal column in Sql Server


Is there a way to alter the precision of an existing decimal column in Sql Server?

Best Solution

ALTER TABLE Testing ALTER COLUMN TestDec decimal(16,1)

Just put decimal(precision, scale), replacing the precision and scale with your desired values.

I haven't done any testing with this with data in the table, but if you alter the precision, you would be subject to losing data if the new precision is lower.