BulkyCopy .Net
It has being ages to get back to cnblogs, Career path had been changed back to .Net development in 4 years ago....Things i just leart from my current project I would like to share with you guys is to use sqBulkCopy to save big volume data in a datatable.
As you might have known, SQL Server provides a function called BCP (Bulky Copy Process), it largely helps us with inserting large amount data into sql tables. Microsoft has created a very similar Ado.net method SqlBulkCopy to perform same way for us, and the performance is pretty good, 18 seconds to save 400,000 rows in the table, Below screen snap illustrate how we can use this functionality in our project framework.

what we need to do is to tell bulkCopy the physcial table name in DB. bulkCopy.ColumnMapping.Add(count, dc.ColumnName) is Mandatory to call. it is like you should tell bulkCopy how is the columName mapping to the DB table column Name.
BulkyCopy .Net的更多相关文章
随机推荐
- Tomcat 实现双向SSL认证
大概思路: 使用openssl生产CA证书,使用keytool生产密钥库 实验环境:RHEL6.4+Tomcat8 一.生成CA根证书,并自签名 1.生成CA密钥 # genrsa [产生密钥命令] ...
- C# 小例子
数组冒泡排序(升序排序): , , , , , , , , , , , }; //第一种 ; i < num.Length - ; i++) { ; j < num.Length - i ...
- {POJ}{3925}{Minimal Ratio Tree}{最小生成树}
题意:给定完全无向图,求其中m个子节点,要求Sum(edge)/Sum(node)最小. 思路:由于N很小,枚举所有可能的子节点可能情况,然后求MST,memset()在POJ G++里面需要cstr ...
- 自动化测试第一季-selenium + python(环境搭建与基础代码解释)
# coding = utf-8 %%%%%%%%%%%%%%%%防止乱码(可加可不加) from selenium import webdriver ...
- php返回数据库查询时出现Resource id #2
1.使用php调用MySQL数据库的过程是不是先用mysql_query(SELECT*...)或mysql_list_dbs()等查询函数返回结果指针(mysql查询函数中还有没有这样的返回指针函数 ...
- matlab计算差分函数diff
A = 3 2 5 6 5 2 1 8 4 2 7 9 >> diff(A,1,1) ans = 2 0 -4 2 -1 0 6 1 >> diff(A,1,2) ans = ...
- Eclipse设置默认注释
在 windows-->preferenceJava-->Code Style-->Code Templatescode-->new Java file点编辑,覆盖原文本: $ ...
- FP 某段SQL语句执行时间超过1个小时,并报错:ORA-01652: 无法通过 128 (在表空间 TEMPSTG 中) 扩展
一.出现如下两个错误:1.某一段SQL语句执行时间超过1个小时:2.一个小时后,提示如下错误:ORA-01652: 无法通过 128 (在表空间 TEMPSTG 中) 扩展 temp 段ORA-065 ...
- LeetCode之Largest Rectangle in Histogram浅析
首先上题目 Given n non-negative integers representing the histogram's bar height where the width of each ...
- 解决: maven编译项目报“非法字符: \65279 ”错误
打包maven项目的时候,出现异常: [INFO] ------------------------------------------------------------------------ [ ...