Q

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 first published in February 2008

Dig deeper on SQL Server Stored Procedures

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close