今天老大让我录入一大批数据,我的第一个想法就是用inser来一条条插入,或者用C#代码读取Excel然后再插入到数据库,经过老大的介绍。我才知道,还有用sql脚本导入数据的方法。呵呵,真的是长知识了。其实代码很简单BULK INSERT cartemp FROM 'd:\1.txt'WITH(FIE...
分类:
数据库 时间:
2014-07-16 19:27:57
阅读次数:
478
使用multi_query(); 去执行SQL语句,执行多条语句多个SQL语句用“;”分开一:没有结果集的语句:$sql="insert into products (cid,name,price,num) values('2','PHP','2.22','10');update products ...
分类:
数据库 时间:
2014-07-15 23:12:08
阅读次数:
325
14.5.13.4Insert Buffering Database applications often insert new rows in the ascending order of the primary key. In this case, due to the layoutof th....
分类:
其他好文 时间:
2014-07-14 22:02:27
阅读次数:
373
模板原型:解决零散数点在已知线段上的出现次数。思想是将线段用长线覆盖,将长线转化成线段树。用权值记录各个数点出现的次数,最后进行查询。代码解释见注释。 1 #include 2 using namespace std; 3 4 const int MAXN = 3e4 + 10; 5 int n.....
分类:
其他好文 时间:
2014-07-14 21:47:46
阅读次数:
173
如果在INSERT语句末尾指定了ON DUPLICATE KEY UPDATE,并且插入行后会导致在一个UNIQUE索引或PRIMARY KEY中出现重复值,则执行旧行UPDATE;如果不会导致唯一值列重复的问题,则插入新行。例如,如果列a被定义为UNIQUE,并且包含值1,则以下 两个语句具有相同...
分类:
数据库 时间:
2014-07-14 21:20:17
阅读次数:
351
How do I insert a space to a NSString.I need to add a space at index 5 into:NString * dir = @"abcdefghijklmno";To get this result:abcde fghijklmnowith...
分类:
其他好文 时间:
2014-07-14 21:12:21
阅读次数:
175
ecshop的浏览历史的样式,例如我修改的是只让浏览历史显示浏览历史的商品名称 而不显示浏览历史的商品的价格和图片首先找到要修改 的文件includes\lib_insert.php找到函数function insert_history()函数里面的$str.=''.$goods['short_n....
分类:
其他好文 时间:
2014-07-14 19:42:09
阅读次数:
200
直接构造insert into t (c1, c2, c3) values (1, 1, 1), (2, 2, 2)使用UNIONinsert into t (c1, c2, c3) (select a1, a2, a3) union all (select b1, b2, b3)利用查询结果ins...
分类:
数据库 时间:
2014-07-13 19:58:40
阅读次数:
232
论文啊,04年一个人的论文。原来线段树还可以这么用。贴代码。#include#include#includeusing namespace std;const int MAX=10005;class BIT{public:int a[MAX<<1];void insert(int pos,int x...
分类:
其他好文 时间:
2014-07-13 19:08:03
阅读次数:
221
STL list 的insert()和erase(),erase(iter++)
分类:
其他好文 时间:
2014-07-13 17:51:48
阅读次数:
174