Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 15264

Inserting into a single heap table from multiple sessions

$
0
0

Is it possible to insert into (let's say 20) from multiple sessions into the same table (heap or not but certainly there is only a single non partitioned target table) and get inserts run in parallel and get faster per row inserts since the operation is parallel.

I am testing inserts into a heap from 2 sessions, I am inserting 10million rows from 1 session which takes 44 seconds but when I insert from 2 sessions the first insert takes about 44 seconds and the second insert only starts after the first one finishes since it's waiting on intent exclusive lock (LCK_M_IX).

Is there any way I can insert data into a table in parallel (I believe bulk insert can but I need to do it from TSQL)?

Thank you


Gokhan Varol


Viewing all articles
Browse latest Browse all 15264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>