如何将默认值等于现有列值的列添加到SQL Server表中?
我试过这个T-SQL语句:
ALTER TABLE tablename
ADD newcolumn type NOT NULL DEFAULT (oldcolumn)
但它给出了一个错误:
The name "oldcolumn" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.