Add default value to an existing column based on If Then Else sql server 2008

前端 未结 2 1706
無奈伤痛
無奈伤痛 2021-01-18 12:06

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 n         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-18 12:49

    But a Check Constraint will just check your entries and not put a default value. This is my exact same problem. However, I researched that a Calculated Column will do the trick.

提交回复
热议问题