Reputation: 51
I am running a java application in which thousands of records to be inserted from one table to another. So I am doing batch insert with 100 records each. My database is SQL Server 2014 and I am using jdbc connection. Is there a faster way that will insert these thousands of records within less time?
Upvotes: 0
Views: 270
Reputation: 122001
Instead of inserting the rows using JDBC batch a faster alternative that would perform everything in the SQL Server would be to use INSERT INTO...SELECT
, which allows to select rows from one table and insert into another.
Upvotes: 3