A
ad
I want to insert about 10000 records into database.
I don't know if the records existed in the database at first.
There are to methods to achieve it.
1. Use select to test if primary key of a record existed in the database, if
not, use insert command to insert the record.
2. Do not test, just use the insert command to insert the record, if the
record existed, the Exception will be raised, ignore the exception.
Which method is better?
I don't know if the records existed in the database at first.
There are to methods to achieve it.
1. Use select to test if primary key of a record existed in the database, if
not, use insert command to insert the record.
2. Do not test, just use the insert command to insert the record, if the
record existed, the Exception will be raised, ignore the exception.
Which method is better?