How to create a primary key

  • Thread starter Thread starter Régis LYARD
  • Start date Start date
R

Régis LYARD

I have an existing SqlCe 2.0 database.
I'd like to add a Primary Key in a table.
I manage to create new table with primary key but I don't know how to modify
an existting table.
Is anybody have the good SQL syntax ?

Thanks
 
You should be able to use the ALTER TABLE Sql command. See the SQL CE books
online for what syntax is supported by Sql Ce.
My guess would be something along the lines of:-
"ALTER TABLE TableName ALTER COLUMN ColumnName PRIMARY KEY"

Peter
 
Back
Top