I want to insert n records into a single table. There may be many concurrent users and they may insert/update/select data from this table. What is better way to insert in a
The general rule is that you should let the database figure out how to do the work. That works better the more you tell it to do in one statement, i.e. you should insert the 1000 records in one go. This will work best for most database servers and most servers do not block reads for writes.
There are exceptions: if the insertion is slow because the server is slow or the table big or complicated it may be better to split the query into groups of small inserts.
An in between method would be to send multiple insert commands for say 10 or 100 rows with commits in between in one big script to the server.
Added: Most database servers do not block reading as in Oracle, IBM DB/2 and MySQl using InnoDB tables. SQL Server on the other hand manages to lock tables even for reads and is not among them.