tags:

views:

21

answers:

1

I am using SQLite GUI Browser to work with the database. I can't find any button to make primary key on two or more columns. How to do this?

A: 

SQLite does not support adding a constraint.

You have to create a new table, specifying its whole column structure, and import old data into the new table. Then remame the new one, after having dropped the old one.

Benoit
I guess you misunderstood my question. Suppose columns are: SID and TranID. I want a composite key on SID, TranID. How to do this?
RPK
Then use the SQLite shell. It is not complicated :) `create table foo(a text, b text, primary key(a,b));`
Benoit
Thanks for the same.
RPK