Integers are quicker. see:
http://fox.wikis.com/wc.dll?wiki~IntVsChrSpeedSurrogate Keys will eliminate the compound key issue.
You may still need some uniqueness constraints that get built into your table, like to make sure that the same invoice item # is not duped for one invoice.
create database inv
create table Inv ( pkInv i primary key, iInvNo i unique )
create table InvItem ( pkInvItem i primary key, fkInv i references Inv, iItm i, unique BinToC( fkInv ) + BinToC( iItm ) tag InvItm )
If you start using views and SQL syntax you will find that you don't need to worry about the compound issues as much. I think it is a wise career move anyway.
>What do you think is best to use in a VFP project when it comes to character indexes or integer indexes? If you use a integer it is very easy to just generate next key. But some times you need a compound index as in browsing items on an invoice. Then I will need a index like Str(invoice_id)+Str(item_id), which is not so easy and fast? to use. What is your opinion on using integer indexes or character indexes as primary key?