插入批量数据的SQL:OLEDB IRowsetFastLoad与Ado.Net使用SqlBulkCopy [英] Inserting Bulk Data in SQL: OLEDB IRowsetFastLoad vs. Ado.Net SqlBulkCopy

查看:468
本文介绍了插入批量数据的SQL:OLEDB IRowsetFastLoad与Ado.Net使用SqlBulkCopy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在评估不同的方法来插入SQL服务器中大量的数据。我发现 的SqlBulkCopy类从ADO。从OLEDB网和 IRowsetFastLoad 接口。据我所知,IRowsetFastLoad不会映射到C#,这是我的基本平台,所以我正在评估,如果这将是值得的,创建一个围绕IRowsetFastLoad的包装,.NET,所以我可以在我的应用程序中使用它。

I am evaluating different methods for inserting large amount of data in SQL server. I've found SqlBulkCopy class from Ado.Net and IRowsetFastLoad interface from OLEDB. As far as I know, IRowsetFastLoad doesn't map to C#, which is my base platform, so I am evaluating if it would be worth it to create a wrapper around IRowsetFastLoad for .net, so I can use it on my application.

任何人都知道,如果IRowsetFastLoad实际上比SqlBulkInsert更好的表现 - 这将是值得创建这样的包装

Anyone knows if IRowsetFastLoad would actually perform better than SqlBulkInsert -- Would it be worthy to create such wrapper?

推荐答案

SqlBulkCopy的 IRowsetFastLoad 的管理相当于,它们具有类似的性能。在客户端,作为一般规则,OLEDB快于ADO.Net由于绑定,其允许进出必需的,因为缓冲器是已知的前方的API(少的存储器复制更快的传输数据的可用性,固定和pre分配)。 ADO.Net给出了一个更容易的编程模型,但无法取出数据ADO.Net瓦特/ OA副本。但是,除了最重要的访问,差别应该是无法衡量的。

SqlBulkCopy is the managed equivalent of IRowsetFastLoad, they should perform similarly. In the client, as a general rule, OleDB is faster than ADO.Net due to the availability of bindings, which allow for a faster transfer of data in and out the API (less memcopy required because the buffers are known ahead, fixed and pre-allocated). ADO.Net gives a much easier programming model, but is not possible to get data out of ADO.Net w/o a copy. But for all but the most critical access, the difference should be impossible to measure.

当它涉及到的事项,该服务器访问的区别,它们都将使用快速加载 INSERT BULK API(不提供直T-SQL)和真正重要的。

Where it comes to the difference that matters, the server access, they both will use the fast load INSERT BULK API (not available from straight T-SQL) and that what really matters.

这篇关于插入批量数据的SQL:OLEDB IRowsetFastLoad与Ado.Net使用SqlBulkCopy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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