日期:2014-05-18  浏览次数:20921 次

SQL批量update,insert优化
第一个问题:
list<string,int> sqlList=new list<string,int>();
如果for循环出来就是下面的SQL

update table set title ='abddd' where id =1;

update table set title ='d' where id =2;
update table set title ='ab' where id =2;
....................


我想写一个存储过程,只要传title值和id值,能不能实现不用循环sqllist?

A.还是只能一条一条传进去?
B.把sql 组合起来传进去?
如“update table set title ='abddd' where id =1;update table set title ='abddd' where id =2......;”

第二个问题:
大批量插入数据大家有何好办法??

------解决方案--------------------
接分路过
游标