I would like to change the data type of a column from money to char(1). Through experimenting I found that the best way to do this (and correct me if I'm wrong) is to drop the column (I don't care about the data in the column) and add a column with the same name. However, there's a constraint (default value of 0) that I need to first drop. I've tried this code:
The difficulty I'm having is:
[ul]
[li]My default value constraint isn't always called 'DF_GRP_CoPayDispFee'. How can I retrieve the name of the constraint on CoPayDispFee?[/li]
[li]Even when the name of the constraint is 'DF_GRP_CoPayDispFee', the update statement fails. It almost seems like I need to call refresh or something because the error message indicates that it is still a money field. How can I call 'refresh' or something?[/li]
[/ul]
Thanks,
Rewdee
Code:
ALTER TABLE GRP DROP Constraint DF_GRP_CoPayDispFee
ALTER TABLE GRP DROP COLUMN CoPayDispFee
ALTER TABLE GRP
ADD CoPayDispFee CHAR(1) NULL
DEFAULT 'F' WITH VALUES
Update GRP Set CoPayDispFee = 'F'
[ul]
[li]My default value constraint isn't always called 'DF_GRP_CoPayDispFee'. How can I retrieve the name of the constraint on CoPayDispFee?[/li]
[li]Even when the name of the constraint is 'DF_GRP_CoPayDispFee', the update statement fails. It almost seems like I need to call refresh or something because the error message indicates that it is still a money field. How can I call 'refresh' or something?[/li]
[/ul]
Thanks,
Rewdee