-
Notifications
You must be signed in to change notification settings - Fork 311
Open
Labels
Needs More Info ℹ️Issues that have insufficient information to pursue investigationsIssues that have insufficient information to pursue investigationsP3Use for tagging low priority issues, impacts a single customer, and is not a critical/high issue.Use for tagging low priority issues, impacts a single customer, and is not a critical/high issue.Triage Done ✔️Issues that are triaged by dev team and are in investigation.Issues that are triaged by dev team and are in investigation.
Description
I m using Sqlbulkcopy with my application and trying to insert bulk 1000000 records in single table. But the approach is 10 Parallel threads will hit with bulk command on same table with 100000 record per each thread. while this thread ware running there will not be any update operation will happen on table. only read operation can happen same time from different thread.
using (SqlBulkCopy bulkCopy =
new SqlBulkCopy(connectionString, SqlBulkCopyOptions.KeepIdentity))
{
bulkCopy.DestinationTableName =
"dbo.BulkCopyDemoMatchingColumns";
try
{
// Write from the source to the destination.
bulkCopy.WriteToServer(reader);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
// Close the SqlDataReader. The SqlBulkCopy
// object is automatically closed at the end
// of the using block.
reader.Close();
}
I don't want any lock on my table and i also want to allow my all threads to bulk insert. I m using default option of bulk. how i can avoided Deadlock in this situation?
Metadata
Metadata
Assignees
Labels
Needs More Info ℹ️Issues that have insufficient information to pursue investigationsIssues that have insufficient information to pursue investigationsP3Use for tagging low priority issues, impacts a single customer, and is not a critical/high issue.Use for tagging low priority issues, impacts a single customer, and is not a critical/high issue.Triage Done ✔️Issues that are triaged by dev team and are in investigation.Issues that are triaged by dev team and are in investigation.