StringBuilder 拼接sql语句比较快


StringBuilder strBuilder = new StringBuilder();
strSql +=

"insert into tbDecRate(Ver,Prop_InsID,Year,Month,Rate,CreateUserID,CreateDate,ModifyUserID,ModifyDate)

values ('1','" + Prop_InsID + "','" + strYear + "','" + strMonth


+ "','" + strRate + "','System',GETDATE(),'System',GETDATE());";

strBuilder.AppendFormat("delete from tbDecRate where Prop_InsID='{0}'and year='{1}' and month='{2}';", Prop_InsID, strYear, strMonth);
strBuilder.AppendFormat("insert into tbDecRate(Ver,Prop_InsID,Year,Month,Rate,CreateUserID,CreateDate,ModifyUserID,ModifyDate)

values ('1','{0}','{1}','{2}','{3}','System',GETDATE(),'System',GETDATE());",Prop_InsID,strYear,strMonth,strRate);
有‘“+ +”’用AppendFormat

更多相关文章

  1. mysql常用命令/语句学习三
  2. 求一SQL语句(如何按某列的值分组且取出每组前几行的数据)
  3. 1)如何用语句来查看一个表内是否建了索引2)或用plsql查看一个表
  4. 高手是怎样炼成的:精妙SQL语句介绍
  5. 如何判断如下的sql语句是否被正确执行了
  6. 在线求助.Select语句包含ERP单据内表头与表身信息
  7. Spring 中jdbcTemplate 实现执行多条sql语句
  8. PB怎么将动态的sql语句以及数组。传给datawindow。
  9. 通过SQL语句访问远程数据库

随机推荐

  1. 在fc8安装TP-Linux WN3210G+USB无线网卡,
  2. 都能看懂的嵌入式linux/android alsa_apl
  3. 鸟哥linux私房菜笔记--vi
  4. linux测试硬盘读写速度
  5. 获取Perl重命名实用程序而不是内置重命名
  6. 进程实际内存占用: 私有驻留内存数(Priva
  7. 移植MT7601U AP Linux 驱动至Orangepi-PC
  8. mongodb在linux服务器上的安装和部分基础
  9. Linux缓存相关知识整理(史上最全!!)
  10. linux7.2光盘自动挂载