Have anyone tried to use the SqlBulkCopy operation to do multiple inserts into a database?
For example if I want to insert 100 rows into a database?
Is it faster ? than doing single inserts in a loop? (where single inserts could be call to a StoredProc that does the insert)
Or is it so that what is sent over to the database is still single inserts, but its more a programmatic way to send multiple stuff to the DB?
Be aware that the SQLBulkCopy leverages the old bcp utility. As such, it typically performs "minimally-logged" inserts, and by default does not support full transactional capabilities. There is information regarding this in the help files. If you're using SQLBulkCopy to do something like a large nightly data load, I'd recommend doing a full DB backup, the bulk copy, and another full DB backup if there were no errors (or a restore if there were). If you're using it for small inserts, I'd think hard about what you might be losing in data integrity if it fails mid-way through a batch.
Copyright (c) Marimer LLC