- SqlBulkCopy in a new powerful feature in ADO.NET 2.0 which let you to load large amount of data into Sql Server table.
- It provides you the same functionality as the bcp command-line, with significant performance advantage. Furthermore, all this occurs in standard manage code!
- In order to use the SqlBulkCopy you must use Sql Server Table as a target table. But in the source, you can use any source which can loaded into DataTable or to implement the IDataReader interface.
- The SqlBulkCopy class has his private connection timeout definition. So if you specified a timeout period as a part of the connection string, it'll ignore it.
- There is a really weird behavior when using some specific number of rows. The error we got when we tried to use the SqlBulkCopy is:
The incoming tabular data stream (TDS) protocol stream is incorrect. The TDS headers contained errors.
The official symptom for this error is when you using SqlBulkCopy to copy some rows from DataTable into SqlServer 2005 table. In most of the time it works perfect, but for some rows number the SqlBulkCopy.WriteToServer() throw a timeout exception.
It happened to us in my current workplace and after we installed the appropriate hotfix (restart required), this problem has been solved.
Everything started tow months ago when I asked my boss to get a ticket to Tech-Ed Israel In the begging of April. Tech-Ed is one of the most interesting conferences for technical people. The fact that this conference takes place in my country (Israel) makes it even better, just a half an hour of flight. It's really good opportunity to learn about the next MS generation, to meet the most interesting and powerful people from MS corporation and to talk with other programmer from my same community. Last week I got an email from Michal (Digital Marketing Group in MS Israel), in which she announced me that I won a free ticket to the next Tech-Ed Eilat (Flight & Hotel included). I probably would have got a ticket from my company, but it's really cool to won one myself.
So, I really hope to see you in the incoming Tech-Ed, and Thanks a lot to Microsoft Israel for this gimmick.