Should I set the primary key of my table to auto_increment
or set it as numeric, generating the key within my application?
Contextualization
I'm developing a C # application and testing it in an Access database, and then passing it to a MySQL database.
One problem that crossed my mind was:
1) With a key of type auto_increment
, to know the primary key of the registry that I saved, I will have to go to the database and fetch it after saving the data.
2) With a manual key (created by the application), I will not need to do step 1), since I have already created the primary key inside the application before saving the data.