ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] sql »yªk §ó·sÄæ¦ì¤Ó¦h¦p¦ó¦ê±µ

[µo°Ý] sql »yªk §ó·sÄæ¦ì¤Ó¦h¦p¦ó¦ê±µ

½Ð°Ý¦U¦ì¦]§ÚÄæ¦ì¦³40­Ó~¥Ø«e¬O¥H¥H¤U¤è¦¡¥h°µ¦ê±µ
¦ý°µ¨ì²Ä1X­Ó¤§«á´Nĵ§i»¡¦ê±µ¹L¦h¤F~
½Ð°Ý¥i¥H«ç»ò°µ§ï¶i©O?
Excel to Azure sql
  1. Sql = "IF NOT EXISTS (SELECT ½s¸¹ from BOM WHERE ½s¸¹ ='" & sLastName & "') " & _
  2.                 " INSERT into BOM (³æ¸¹, ½s¸¹) " & _
  3.                 " VALUES ('" & sFirstName & "', '" & sLastName & "')" & _
  4.                 " else " & _
  5.                 " update BOM set" & _
  6.                 " Äæ1= '" & s©P´Á & "'," & _
  7.                 " Äæ2 = '" & s¯S®í & "'," & _
  8.                 " Äæ3 = '" & s¤é´Á & "'," & _
  9.                 " Äæ4 = '" & s½s¸¹ & "'," & _
  10.                 " Äæ5 = '" & sÀ\§O & "'," & _
  11.                 " Äæ6 = '" & sÃþ§O & "'," & _
  12.                 " Äæ7 = '" & s«~¦W & "'," & _
  13.                 " Äæ8 = '" & s¼Æ¶q & "'," & _
  14.                 " Äæ9 = '" & s³Æµù & "'," & _
  15.                 " Äæ10 = '" & s²§±` & "'," & _
  16.                 " Äæ11 = '" & s¥N¸¹ & "'" & _
  17.                 " where ½s¸¹ ='" & sLastName & "'"
½Æ»s¥N½X

¦^´_ 1# starry1314

«Ü¤[¨S¼gµ{¦¡¤F~SQL»yªk³Ìªñ¦b½Æ²ß¤¤
¦L¶H¤¤³o¼Ë´N¥i¥HµL­­String~
¸Õ¸Õ¬Ý§a~
  1. Sql = "IF NOT EXISTS (SELECT ½s¸¹ from BOM WHERE ½s¸¹ ='" & sLastName & "') "
  2. Sql = Sql +" INSERT into BOM (³æ¸¹, ½s¸¹) "
  3. Sql = Sql +" VALUES ('" & sFirstName & "', '" & sLastName & "')"
  4. Sql = Sql +" else "
  5. Sql = Sql +" update BOM set"
  6. Sql = Sql +" Äæ1= '" & s©P´Á & "',"
  7. Sql = Sql +" Äæ2 = '" & s¯S®í & "',"
  8. Sql = Sql +" Äæ3 = '" & s¤é´Á & "',"
  9. Sql = Sql +" Äæ4 = '" & s½s¸¹ & "',"
  10. Sql = Sql +" Äæ5 = '" & sÀ\§O & "',"
  11. Sql = Sql +" Äæ6 = '" & sÃþ§O & "',"
  12. Sql = Sql +" Äæ7 = '" & s«~¦W & "',"
  13. Sql = Sql +" Äæ8 = '" & s¼Æ¶q & "',"
  14. Sql = Sql +" Äæ9 = '" & s³Æµù & "',"
  15. Sql = Sql +" Äæ10 = '" & s²§±` & "',"
  16. Sql = Sql +" Äæ11 = '" & s¥N¸¹ & "'"
  17. Sql = Sql +" where ½s¸¹ ='" & sLastName & "'"
½Æ»s¥N½X
¤@¤À§V¤O¡A¤@¤À¦¬Ã¬¡C
µo°ÝÃD«e¥i¥H¥ý·j¯Á¤º¤å¬O§_¦³¬ÛÃö½d¨Ò¡C

TOP

¦^´_ 2# faye59


    ·PÁ«üÂI~
ÀY¸£¤Ó¦º ¸j¦b¤@¦ê¦r¦ê¤º

TOP

        ÀR«ä¦Û¦b : §g¤l¦p¤ô¡AÀH¤è´N¶ê¡AµL³B¤£¦Û¦b¡C
ªð¦^¦Cªí ¤W¤@¥DÃD