简体   繁体   English

如何同时发送多行到mysql(如批量复制)?

[英]how to send multiple row to mysql at same time(like bulk copy)?

I am using asp.net + Mysql. 我正在使用asp.net + Mysql。

I have multiple rows in my dataset; 我的数据集中有多行; I have to store the rows in my database table. 我必须将行存储在数据库表中。 How to do that? 怎么做?

Use the insert statement .. 使用插入语句..

INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);

this inserts 3 rows 这将插入3行

a | b | c
--+---+--
1 | 2 | 3
4 | 5 | 6 
7 | 8 | 9

see http://dev.mysql.com/doc/refman/5.1/en/insert.html 参见http://dev.mysql.com/doc/refman/5.1/en/insert.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM