How can I add a column to an existing table?

穿精又带淫゛_ 提交于 2019-12-12 10:29:31

问题


How can I alter a table in SQL Server Compact Edition (SQL CE)?

I have an existing table, and I need to add an IDENTITY column.


回答1:


You add a column in the same way you would add it in other versions of SQL Server:

This adds a primary key identity column called IdColumnName to the table tableName:

ALTER TABLE tableName
ADD COLUMN IdColumnName INTEGER IDENTITY (1,1) PRIMARY KEY

See the ALTER TABLE syntax for SQL Server compact edition.




回答2:


Hope these examples help some one

ALTER TABLE [sales_order] ADD COLUMN  [price] MONEY NULL;
ALTER TABLE [order_details] ADD COLUMN  [price] MONEY NULL;


来源:https://stackoverflow.com/questions/2840021/how-can-i-add-a-column-to-an-existing-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!