but there are nothing unique in each row. is there a way to add a filed to a database with incremental numbers to be able to create a Primary Key? i have a zip code database with over 60,000 entries with no Primary Key. i need to add a unique field to each row. is there anything out there that will do this for me?
If it is a zip code database , then you can make zipcode as yr primary key, since that should be unique Thanks Lavee
this database has over 70,000 rows and i need to add an ID field to it. is there a way to do this without spending hours manually adding to it?
Exact method depends on the database that you're using ... MYSQL / SQL Server etc. which is it? Also, why do you need a primary key, what will be its purpose? For a look-up table such as this, a primary key is not essential.
i have a program that generates php scripts to display the database and it will not do what it does without the db having a Primary Key. thats the ony reason. mysql database.
You can add a new column as an auto increment and when you do it will automatically assign all the values of the existing rows, of course.
Just create a table right next to it with exact same structure as the Zip Code table except it has an AutoIncrement datatype field. Then just select all from izp table, and insert to new table, lettting the ID be created by itself
what i ended up doing is i imported the database, then i created an ID column with the proper variables and it was successful. each entry now has a unique ID number. thanks for everyones reply here, rep added to you.