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

[µo°Ý] SQL §å¦¸¤W¶Ç¸ê®Æ,§Ö³tªº¤è¦¡?

[µo°Ý] SQL §å¦¸¤W¶Ç¸ê®Æ,§Ö³tªº¤è¦¡?

¤U¤è¬O§Ú¥Ø«e§å¦¸¤W¶Ç¸ê®Æ¨ìMSSQL¤W­±ªº¤è¦¡
²³æ»¡,´N¬O§â¦r¦ê³s¦b¤@°_,µM«á°õ¦æ³s½uµ{¦¡
¦ý¦¹ºØ¤è¦¡¥ú¬O¤W¶Ç¤@¸Uµ§¸ê®Æ,´N­nªá¨â¤ÀÄÁ¤F...
½Ð°Ý¦U¦ì¤j¤j¦³§ó§Öªº§å¦¸¤W¶Ç¤è¦¡¶Ü?
  1. For i = 1 To 10000
  2.     strSQL = "INSERT INTO customer VALUES ('Bob'," &  i & ")"
  3.     If i = 1 Then strSQL2 = strSQL Else strSQL2 = strSQL2 & ";" & strSQL
  4. Next
  5. conn.Execute (strSQL2)
½Æ»s¥N½X
PKKO

https://mariadb.com/kb/en/sql-99/begin-end-compound-statement/

ÃöÁä¦r

ms sql begin  insert

TOP

¦^´_ 3# joey0415


    ·PÁ¤j¤jªº¦^ÂÐ
¤£¹L¤p§Ì¬Ý¤£¤jÀ´....
§ä¤£¨ì·s¼W¸ê®Æ¥H¤Î³s½uªº¦a¤è
¬[³]§Ú¦³1¸Uµ§¸ê®Æ­n·s¼W,conn¬O³s½u«ü¥O,¨º§Ú¤U¤èªºµ{¦¡½X¸Ó¦p­×§ï?
¥H¤Î¬Ý¨ìmsdn¤Wªº¤j¤j­Ì»¡,°Ñ¼Æ¬d¸ßªk¬O¥Ø«e¤½»{¥i¥H§¹¬ü¨¾¿m SQL Injection ªº§@ªk¡C
¤£ºÞ¬O¦óºØ SQL¡A¥u­n§â¥N¤J¸ê®Æ­Èªº³¡¥÷¥Î°Ñ¼Æ¥h´À¥N´N¦æ¤F,±zªº¤è¦¡¤]¬O¥Î°Ñ¼Æ¬d¸ßªk¶Ü?
©êºp¤p§Ì¬OSQL·s¤â...

For i = 1 To 10000
    strSQL = "INSERT INTO customer VALUES ('Bob'," &  i & ")"
    If i = 1 Then strSQL2 = strSQL Else strSQL2 = strSQL2 & ";" & strSQL
Next
conn.Execute (strSQL2)
PKKO

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD