Is it possible to alter an existing column to accept a default value based on another column value?
For Eg:
Create table #Temp
(
TempId int not null
,TransCode int --values of 1 / 2 or 3
,ReasonCode int
)
The default value for ReasonCode is based off TransCode. When TransCode is 1 and ReasonCode is Null then 99 else ReasonCode
How do I add this default constraint?