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
2010-10-25 14:59:40
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
2010-10-25 15:06:54
Then use the SQLite shell. It is not complicated :) `create table foo(a text, b text, primary key(a,b));`
Benoit
2010-10-25 15:34:35
Thanks for the same.
RPK
2010-10-25 16:09:38