列名 类型 说明
LendDate 日期 借阅日期,默认值为当前日期
WillDate 日期 应归还日期,默认值为借阅日期+1个月
要求如上,如何给WillDate列添加默认约束?
------解决方案--------------------
- SQL code
alter table t add constraint [DF_t_LendDate] default(getdate()) for LendDategoalter table t add constraint [DF_t_WillDate] default(dateadd(month,1,getdate())) for WillDate go