快速插入200万行到SQL Server [英] Insert 2 million rows into SQL Server quickly

查看:155
本文介绍了快速插入200万行到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须从文本文件中插入大约2百万行。

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 类。


允许您有效地批量加载来自
另一个源的数据的SQL Server表。 p>

Lets you efficiently bulk load a SQL Server table with data from another source.

有一个很酷的 blog post 关于如何使用它。

There is a cool blog post about how you can use it.

这篇关于快速插入200万行到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆