Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Database Update using Multithreading

I have a requirement to update 20 tables in a SQL Server database in a C# application. For better performance, I am planning to use multiple threads for updating tables. Could anybody refer any example link which gives idea for this kind of operation?

Also, as per my understanding, if I use multi threading, then I have to use different connection object for each thread. In that case, how I can put multiple threads in a single transaction, which are basically using different connection objects?

like image 342
techmad Avatar asked Mar 03 '26 08:03

techmad


1 Answers

Use TPL (task parallel library), here is an example http://safeery2k.wordpress.com/2013/09/17/ado-net-using-tpl/

like image 139
safeer ahmad Avatar answered Mar 05 '26 20:03

safeer ahmad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!