Bulk insert, asp.net

。_饼干妹妹 提交于 2019-12-06 03:09:01

I've used the SqlBulkCopy class before to do a couple million adds. It seemed pretty handy.

You may not want to execute an INSERT 10,000 times, but you can wrap those 10,000 inserts into 1 transaction.

You can try SSIS for this purpose

You can INSERT a SELECT like this:

INSERT INTO myTable (a, b, c) SELECT d, e, f FROM anotherTable WHERE ...

Hope it helps.

With SQL Server 2008 you can pass the C# data set (the actual DataTable object) as a table valued parameter. The parameter is available in your Transact-SQL code as an @table variable you can query and manipulate.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!