I am using Visual Studio web application using ASP.NET MVC & C#. I have an Excel file of more than 100000 records for import into SQL Server 2008 R2.
I have used SqlBulkCopy
with ado.net DataTable
to copy data to a table (Table1
).
Then validating and processing data and marking with valid/invalid.
Then adding and updating records to 3 tables (Table2
, Table3
and Table4
) from Table1
using a stored procedure.
Table4
contains 2 triggers and it is using cursor to update several records related to it inside Table4
and another table (Table2
).
When testing it is taking 1 minute for 10000 records from my local machine with debug mode.
If 10 or 100 users imports at same time, would it support?
Is there any better process to improve and supports for many concurrent users?
My computer configuration:
- Windows 10 64Bit
- AMD FX QuardCore 3.6 GHz processor
8GB RAM
Excel file contains 50 columns
- BulkCopy takes 2 - 3 seconds
- Stored procedure takes 30 seconds to 2 minutes
When I test it with 5 concurrent user, 2 or 3 process successfully executed and I get this error:
Transaction (Process ID 66) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.