Is it possible to limit CPU usage at SqlBulkCopy?
When I execute my code (see below), CPU usage on SQL server jumps to 100%. I'd like to limit this to, let's say, 50%. Is this possible?
Code:
string connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ToString();
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connectionString))
{
bulkCopy.DestinationTableName = "dbo.CSVFile";
bulkCopy.BulkCopyTimeout = 600;
bulkCopy.BatchSize = 1000;
bulkCopy.WriteToServer(tableCSV);
}
EDIT: This code is running on seperate machine from the db server.
Why I need to limit CPU usage: this SQL server has multiple databases, one of them is acceseed constantly from two computers, each of them does a couple of queries per second. This two computers operate two big machines, so every time one of this computer waits for his queries to execute, he stops his machine, waits for queries to execute and then runs his machine again. So every time I run something on SQL server that consumes a lot of CPU, that stops some machines in production.