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

相关文章:

  • 2022-01-20
  • 2022-02-11
  • 2021-06-10
  • 2022-01-15
  • 2022-02-16
  • 2022-01-04
  • 2022-02-09
  • 2021-12-13
猜你喜欢
  • 2022-12-23
  • 2021-10-24
  • 2022-01-28
  • 2021-12-15
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案