Problem solve Get help with specific problems with your technologies, process and projects.

Using BULK INSERT to insert rows from SQL Server dataset to table

Learn how to use BULK INSERT to import all SQL Server dataset rows to a table.

I am importing data from a.xls file. First I took the data in the dataset and called the INSERT stored procedure. The problem is that while calling the INSERT stored procedure, the stored procedure is called to each row for the dataset. How can I use BULK INSERT for inserting all rows from a SQL Server dataset to a table?
You can use the SqlBulkCopy class in ADO.NET to quickly and efficiently load a SQL Server table from a DataTable object. For more details, read BULK insert to import data from file to SQL Server database.
This was last published in February 2008

Dig Deeper on SQL Server Stored Procedures

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.