Geeks With Blogs

News
The Wrecking Bawl Destructuring query language, one keyword at a time.
I just discovered the SqlBulkCopy class in .Net 2.0, and it seems awesome!  Now I don't have to shell out to BCP anymore!  We'll see though, I haven't done any performance testing yet... Posted on Tuesday, April 10, 2007 10:06 PM all tech stuff , C# , SQL Server | Back to top


Comments on this post: SqlBulkCopy

# re: SqlBulkCopy
Requesting Gravatar...
Hi,

Check out my article on SqlBuildCopy.
http://gridviewguy.com/ArticleDetails.aspx?articleID=233
Left by AzamSharp on Apr 10, 2007 11:39 PM

# re: SqlBulkCopy
Requesting Gravatar...
Cool, thanks. Right now I'm using a DataTable that's built from a fixed-field text file, so it will be interesting to see what BatchSize works best.
Left by Alex Bransky on Apr 10, 2007 11:46 PM

# re: SqlBulkCopy
Requesting Gravatar...
The batch size is going to make less of a difference than if you can eliminate the DataTable from the mix. You're wasting a lot of resources trying to load all the data into memory first instead of streaming the data to SqlBulkCopy directly from the file.
Left by Bruce Dunwiddie on Apr 11, 2007 1:26 PM

# re: SqlBulkCopy
Requesting Gravatar...
I don't know how to parse the fields out directly to SqlBulkCopy without the DataTable in between.
Left by Alex Bransky on Apr 11, 2007 6:07 PM

# re: SqlBulkCopy
Requesting Gravatar...
Check out my site and see how I go about it, FixedWidthDataReader in your case. I'm not saying I've got the only component that can do it, it just bugs me when I see solutions for large data that just changes the scaling metrics, doesn't necessarily provide a permanent fix. I'm pondering putting together a nice fully documented plea to MS that they start looking at enterprise level data scalability issues in a cross product line perspective as data mining and management is becoming a larger and larger issue that everyday developers are having to deal with without framework tools built for the job.
Left by Bruce Dunwiddie on Apr 12, 2007 7:16 PM

# re: SqlBulkCopy
Requesting Gravatar...
FYI, one irritating thing about SqlBulkCopy (irritating if you don't know that it does it) is that you have to specify the identity column in your DataTable before you call WriteToServer, otherwise the columns will map incorrectly. If you want to write the values in the identity column to the db there's a KeepIdentity option.
Left by Alex Bransky on Apr 17, 2007 6:02 AM

# re: SqlBulkCopy
Requesting Gravatar...
Humm... interesting,

I used bulkcopy class before, but I rarely use it any way

Thanks for writing, most people don't bother.
Left by web development company on Aug 10, 2009 8:39 PM

# re: SqlBulkCopy
Requesting Gravatar...
Thank trusted to talk about this. I believe very strong about and want to learn more. If it is determined, you gain additional insight, maybe you do not mind adding additional terms are very similar, of which more information? It would be very useful for me and my friends help.
Left by nike dunk sb space jam on Aug 19, 2011 1:33 PM

Your comment:
 (will show your gravatar)


Copyright © Alex Bransky | Powered by: GeeksWithBlogs.net