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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top