快速向 SQL Server 插入 200 万行 [英] Insert 2 million rows into SQL Server quickly
本文介绍了快速向 SQL Server 插入 200 万行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须从一个文本文件中插入大约 200 万行.
I have to insert about 2 million rows from a text file.
通过插入,我必须创建一些主表.
And with inserting I have to create some master tables.
将如此大量的数据插入 SQL Server 的最佳和快速方法是什么?
What is the best and fast way to insert such a large set of data into SQL Server?
推荐答案
您可以尝试使用 SqlBulkCopy
类.
You can try with SqlBulkCopy
class.
让您高效地批量加载包含数据的 SQL Server 表另一个来源.
Lets you efficiently bulk load a SQL Server table with data from another source.
有一个很酷的博文 介绍如何使用它.
There is a cool blog post about how you can use it.
这篇关于快速向 SQL Server 插入 200 万行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文