Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2011-11-22 : 14:12:20
|
| How do I change the datatype of a column in a view?It is currently decimal(32,2)I would like to change it to decimal(14,2) |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2011-11-22 : 14:16:01
|
| The The fields in the view are totals of a field. The field in the underlying table is decimal(14,2) |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2011-11-22 : 14:39:32
|
| When you do math of NUMERIC/DECIMAL columns the resulting precision and scale can be changed. Given that, you probalby just need to CAST the result to the precision and scale you want (14,2). For refernce, here is a link that describes when and how the precision and scale are changed:http://msdn.microsoft.com/en-us/library/ms190476.aspx |
 |
|
|
|
|
|