I am working on doing a large scale insert/update operation.
So I am using SqlBulkCopy
.
SqlConnection myConnection = new SqlConnection(myConnectionString);
try
{
myConnection.Open();
SqlBulkCopy myCommand = new SqlBulkCopy(myConnection);
myCommand.DestinationTableName = "myDestinationTableName";
//Below method has four overloads;
//of which I am interested in the two mentioned below.
myCommand.WriteToServer();
myCommand.Close();
}
finally
{
myConnection.Close();
}
But I stumbled upon these two versions of WriteToServer
method.
Question : What are the pros and cons of one over another? Which one is faster?