Possible Duplicate:
Add column, with default value, to existing table in SQL Server
我在 sql server 中有一个表,但想添加一个额外的全零列
执行此操作的最佳方法是什么
att1 att2
---------
1.0 5.8
2.7 3.8
5.1 6.8
变成了
att1 att2 extra
----------------
1.0 5.8 0.0
2.7 3.8 0.0
5.1 6.8 0.0
最佳答案
如果我没记错的话,应该是这样的:
ALTER TABLE table_name
ADD extra REAL DEFAULT 0
参见:http://msdn.microsoft.com/en-us/library/ms190273.aspx
参见:Add a column with a default value to an existing table in SQL Server
关于sql-server - 向表sql server添加一列零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10342818/