I am using the SqlBulkCopy
class for do the bulk data insertion. Everything has worked perfectly, but in recommending this to my co-workers, while proving efficiency, they questioned how it works.
In my searches, I could see that SqlBulkCopy
works similar to bcp utility . So I went after information, but I did not find anything very detailed.
To understand better, I started SQL Server Profiler
to try to catch the generated queries, but to my surprise, apparently the data that was entered was not sent via SQL command.
Now I'm even more confused. Does SqlBulkCopy
work with some kind of service provided by the bcp utility , sending it the data to be inserted? How is this mass insertion work done? How can this be so fast?
During data insertion, is there any risk that the tables will be locked? And if an error occurs during the process, how does it behave?