Hi

I have a requirement that the primary keys (auto generated) in a table never
repeat in the life of the database. It works fine in case a record is
deleted from anywhere but the bottom of the table. But in case of truncation
it does not work so. Currently what is happening is 

say I have records with PrimaryKeys 1,2,3,4,5  
1 aaaaa
2 bbbbb
3 ccccc
4 ddddd
5 eeeee

and I delete record 5. and add a new recod 'ffffff'. The table looks like
1 aaaaa
2 bbbbb
3 ccccc
4 ddddd
5 ffffff

I want it to have the primary key as 6 and not 5. And look like

1 aaaaa
2 bbbbb
3 ccccc
4 ddddd
6 ffffff

Making sure that the primary key is not reused. How can I achieve this.

thanks
-- 
View this message in context: 
http://www.nabble.com/Avoiding-reuse-of-PrimaryKey-values%2C-even-in-case-of-truncation-tp21491295p21491295.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to