DCSIMG
SqlBulkCopy - .NET Geek

.NET Geek

"It is upon the Trunk that a gentleman works" - Confucius

Browse by Tags

All Tags » SqlBulkCopy (RSS)
Importing Large Xml Files to SQL Server Using SqlBulkCopy
Say you have a large Xml file that contains relatively tabular data that you want to import into SQL Server. There are several ways to go about this. Let’s look at a couple of options. Load the file into an XDocument. Extract elements from the DOM using Linq and then use ADO.Net to insert the data into the database. Load the data into a DataSet using ReadXml and save the data to the database Read through the data using an Xml reader and save each record to the database Options number 1 and 2 requires...
SqlBulkCopy Bug Workaround
We are using SqlBulkCopy to import large xml documents into a database. However, we encountered a “minor” bug in the .Net Framework related to table naming. It turns out that if you have a dot “.” in the table name, SqlBulkCopy doesn’t work. The problem has been reported and a KB article is available , but without a workaround besides renaming the table. Our problem wasn’t with the actual name of the table(s), but with the name of the schema. The schema naming convention used in that specific database...