I have a table with a payment decimal(5, 2)
column and I want to add a computed column to a table:
ALTER TABLE tbl
ADD colComputed AS (ROUND(payment , 0)) / 0.6)) PERSISTED
This works, however, colComputed
ends up being numeric(12, 6)
.
I tried specifying ALTER TABLE tbl ADD colComputed decimal(5, 2) AS ...
, but it appears to be invalid syntax. How can I force the computed column to be decimal(5, 2)
?