SQLite Forum

Best way to handle unique column needs
Login
I have an existing application that I have brought over into SQLite, or I'm at early stages of doing so.

Right now I'm dealing with the issue of making my old unique key fields be that again but in SQLite.

So I have 50 tables which have such a column.. used to be the unique column in old database, the column has values in the data from the old database.. now I need that field to be the same.. a unique column numeric integer 32 bit value, and thus I need it to auto fill itself with a value, either overwriting my already there values, or starting after the highest present value

Can you think of a way to do the above in SQLite? 

I see that I can fetch the last rowid after an insert, so if I was starting from scratch I would fetch that and save it in a column to use as my unique identifier.  I thought having the used to be our unique field set to primary key, that it would get the rowid value in it, but actually I'm getting the reverse, I'm getting the old field values in selects where I ask for the rowid

So I'm confused as to how to get my column of choice to be a unique numeric column since the rowid won't come into it at present.. I save a new record and my numeric primary key returns null or zero even after fetching back.. it doesn't have the rowid in it.. will an auto incrementing restraint help me ?  I'd have to remake my tables to do that.. from what I understand

Any help on making my old column still be a unique numeric identifier column appreciated.  Or other comments as I am new.