日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

sql不替换uid的更新数据语句

發布時間:2023/12/15 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 sql不替换uid的更新数据语句 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

1.覆蓋數據時uid主鍵不修改的語句

on duplicate key update

private void ImportMyData(string name,string year,List<MyInfoDetail> listMyInfo) {IDbShell shell_w = Common.GetIDbShell(ActionType.Read); try { shell_w.BeginTransaction(); if(listMyInfo!=NULL &&listMyInfo.Count>0) { foreach (var exeein listMyInfo) { string Uid=exee.ex_id+exee.exam_no+exee.es_num; string sql = @"insert into `userinfo` VALUES(@0,@1,@2,@3,@4,@5,@6,'A',@7,@8,@9,@10,@11,@12,@13,@14,@15,@16,now(),now())on duplicate key update id=@1,num=@2,no=@3,name=@4,cert_id=@5,cert_no=@6,code=@7,lxdm=@8,cldm=@9,ssdm=@10, ss=@11, cl=@12,bj=@13,mc=@14,qk=@15,sj=@16,update_time=now(),create_time=now();"; shell_w.ExecuteQueryDataSet(sql, Uid, Id, num, no, name, cert_id, cert_no,code, exee.wglxdm, cldm, ssdm, ss, cl, bj,mc, qk, sj); } } } shell_w.Commit(); } catch(Exception ex) {shell_w.Rollback();Common.SaveErrorLog(ex.Message);shell_w.EndTransaction(); }finally{shell_w.Close();shell_w.Dispose();} }

?

轉載于:https://my.oschina.net/u/3544533/blog/1788724

總結

以上是生活随笔為你收集整理的sql不替换uid的更新数据语句的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。