SQLServerBulkCopy JDBC driver - How it works

318 Views Asked by At

Exploring SQLServerBulkCopy JDBC from Spring Batch to copy millions of records from Azure SQL to SQL server installed on Azure VM

Source is SQL view and Destination is SQL table

Batchsize = 250k and Count of records = 20Million

Question is related to reading from source. As batch size is 250K , it is not going to read entire 20Million into memory. But wondering how it works internally

  1. Is it going to make 80 calls (20Million/250K) to source database?
  2. If above one is true , how is it going to keep track of records read with out providing sort key in the code. Sample below or i searched for other samples, no where i found sort key has to be given for batch size to work. Everywhere batchsize impacts on writes to destination is mentioned but not on reads
  3. Can streaming be enabled in above SQL server to SQL server scenario?

I searched a lot finding answer for #1 , but could not find good information. Any insights is very helpful. Thanks!

https://learn.microsoft.com/en-us/sql/connect/jdbc/using-bulk-copy-with-the-jdbc-driver?view=sql-server-ver15

0

There are 0 best solutions below