首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

SQL批量update,insert优化解决办法

2012-03-09 
SQL批量update,insert优化第一个问题:liststring,int sqlListnew liststring,int()如果for循环出来

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......;”

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

[解决办法]
接分路过
游标

热点排行