SQLite error

I have to clean up a Sqlite database. In the database exists a table with 5 text columns. One of the columns holds a numeric value (as text, that is). This column is designated primary key. Upon looping through the table and making corrections in text fields I can’t write to the table receiving an error ‘Invalid token’ with the primary key (because it is type: text I presume).

How can I change the text column in integer (I tried changing the type but then I get the ‘datatype mismatch’ error)??

Upon adding a new integer column and marking it PK I get the error ‘Cannot add a Primary Key’…

You can’t change columns in SQLite and having two primary keys in SQL is not legal. The best answer I can give you is to export all of the data and then reimport it into a new table with the right schema.

Many of the tools that manipulate SQLite db files will handle all of that for you to simulate that ability, but ultimately it’s just export/import.

OK, I tried that already. I created a new table with an identical scheme but I changed the key from text into integer and marked it PK.
Upon loading a CSV I get the datatype mismatch…

[edit] Adding a new column with auto increment fixed it… Thanks