Shiny
Shiny

Reputation: 1083

How can I add a column to an existing table?

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.

Upvotes: 14

Views: 15950

Answers (2)

Oded
Oded

Reputation: 498942

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.

Upvotes: 16

samantha dias
samantha dias

Reputation: 31

Hope these examples help some one

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

Upvotes: 3

Related Questions