为什么BCP这么快? [英] Why is BCP so fast?

查看:85
本文介绍了为什么BCP这么快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此用于将数据插入SQL Server DB的BCP非常快.做什么使它变得如此之快?

解决方案

在SQL Server中,BCP输入的记录方式与传统的插入语句截然不同. SQL如何决定如何处理事情取决于许多因素,而大多数开发人员甚至从未考虑过某些因素,例如数据库设置为使用哪种恢复模型.

bcp使用与BULK INSERT和SqlBulkCopy类相同的功能.

更多详细信息在这里 http://msdn.microsoft.com/en-us/library/ms188365.aspx

最重要的是,与常规操作相比,这些批量操作记录的数据更少,并且能够指示SQL Server忽略其对传入数据的传统检查和平衡.所有这些共同作用旨在使其更快./p>

So BCP for inserting data into a SQL Server DB is very very fast. What is is doing that makes it so fast?

解决方案

In SQL Server, BCP input is logged very differently than traditional insert statements. How SQL decides to handle things depends on a number of factors and some are things most developers never even consider like what recovery model the database is set to use.

bcp uses the same facility as BULK INSERT and the SqlBulkCopy classes.

More details here http://msdn.microsoft.com/en-us/library/ms188365.aspx

The bottom line is this, these bulk operations log less data than normal operations and have the ability to instruct SQL Server to ignore its traditional checks and balances on the data coming in. All those things together serve to make it faster.

这篇关于为什么BCP这么快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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