<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Fastest Way to Insert Data in MS SQL on Professional developer</title><link>https://www.professionaldev.dev/series/fastest-way-to-insert-data-in-ms-sql/</link><description>Recent content in Fastest Way to Insert Data in MS SQL on Professional developer</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 08 May 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://www.professionaldev.dev/series/fastest-way-to-insert-data-in-ms-sql/index.xml" rel="self" type="application/rss+xml"/><item><title>Fastest Way To Insert the Data in MS SQL – Part 4 – Turning on the `useBulkCopyForBatchInsert` Parameter</title><link>https://www.professionaldev.dev/post/java/mssqlserver/fast_insert_part4/</link><pubDate>Wed, 08 May 2024 00:00:00 +0000</pubDate><guid>https://www.professionaldev.dev/post/java/mssqlserver/fast_insert_part4/</guid><description>
&lt;p&gt;In previous discussions, we established that bulk insert and multi-value batched inserts represent the
fastest methods for inserting data into an MS SQL Server database.
However, before concluding this series, let's explore another option.&lt;/p&gt;
&lt;p&gt;MS SQL Server has introduced the parameter &lt;code&gt;useBulkCopyForBatchInsert&lt;/code&gt;,
which automatically activates the bulk API for batched inserts.
This functionality operates at the database driver level,
enabling it to work seamlessly with both regular parameterized inserts and Hibernate inserts.&lt;/p&gt;</description></item><item><title>Fastest Way To Insert the Data in MS SQL – Part 3 – Multi-value insert vs Bulk Api</title><link>https://www.professionaldev.dev/post/java/mssqlserver/fast_insert_part3/</link><pubDate>Sun, 11 Feb 2024 00:00:00 +0000</pubDate><guid>https://www.professionaldev.dev/post/java/mssqlserver/fast_insert_part3/</guid><description>
&lt;p&gt;In a previous post, we concluded that the Bulk API insert is the fastest way
to insert data into an MS SQL Server database if the batch size is reasonably
large. For Jdbc Template inserts, we created a regular insert statement in the
form of &lt;code&gt;insert into table (c1, c2, c3) values (v1, v2, v3)&lt;/code&gt;, where &lt;code&gt;c1, c2&lt;/code&gt;,
and &lt;code&gt;c3&lt;/code&gt; are column names, and &lt;code&gt;v1, v2&lt;/code&gt;, and &lt;code&gt;v3&lt;/code&gt; are values.&lt;/p&gt;</description></item><item><title>Fastest Way To Insert the Data in MS SQL – Part 2 – Hibernate vs Prepared Statement vs Jdbc Template vs Bulk Api</title><link>https://www.professionaldev.dev/post/java/mssqlserver/fast_insert_part2/</link><pubDate>Sat, 21 Oct 2023 00:00:00 +0000</pubDate><guid>https://www.professionaldev.dev/post/java/mssqlserver/fast_insert_part2/</guid><description>
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the previous post &lt;a href="../persist_vs_saveall/"&gt;Fastest way to insert the data in MS SQL - Part 1 Hibernate Batching&lt;/a&gt;
we compared the performance of Hibernate inserts with batching turned off vs batching turned on.
In this post, we will explore other ways to insert data into MS SQL server and compare performance with Hibernate.&lt;/p&gt;
&lt;p&gt;We will consider four different ways to persist data:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Using Hibernate batching, calling persist method.&lt;/li&gt;
&lt;li&gt;Manually inserting data using a prepared statement with batching.&lt;/li&gt;
&lt;li&gt;Using Spring Data Jdbc Template with batching.&lt;/li&gt;
&lt;li&gt;Using Microsoft Bulk API.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="hibernate-batching"&gt;Hibernate Batching&lt;/h3&gt;
&lt;p&gt;Hibernate batching is implemented as following:&lt;/p&gt;</description></item><item><title>Fastest way to insert the data in MS SQL - Part 1 Hibernate Batching</title><link>https://www.professionaldev.dev/post/java/mssqlserver/persist_vs_saveall/</link><pubDate>Thu, 05 Oct 2023 00:00:00 +0000</pubDate><guid>https://www.professionaldev.dev/post/java/mssqlserver/persist_vs_saveall/</guid><description>
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Currently, my team is focused on optimizing the performance of our
web services. Our data manipulation tasks primarily rely on Hibernate for
interacting with our MS SQL Server database. Hibernate provides a convenient
and straightforward API for handling data, particularly for persisting individual
or interconnected objects (object graph).
However, when it comes to bulk operations, Hibernate's default behavior
may not be as efficient. To address this, you can enhance performance by
enabling Hibernate batching in the &lt;code&gt;application.properties&lt;/code&gt; file.&lt;/p&gt;</description></item></channel></rss>