Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
metser
Starting Member
27 Posts |
Posted - 2006-11-02 : 04:20:11
|
Hello,I have a web page where a user needs to select a number of items (1-100). He is then presented with a dynamically created form, with 8 columns and up to a 100 rows (according to the number of items he selected). He then proceeds to fill out the information on each of this rows, and submits the form. What I would like to do next is to INSERT the information to my DB. However, creating a loop which goes through each row and creates an Inserts the information to the DB seems problematic (CPU and connection wise)... is there any other way except coding the following on my ASP page:'sample codeFOR EACH row IN form 'up to 100 rows!! INSERT INTO tbl_Items (item_1, item_2 .... item_8) VALUES ("form_field_1, form_field_2 .... form_field_8)NEXTThank you |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-11-02 : 04:26:47
|
use SELECT ... UNION ALLINSERT INTO tbl_Items (item_1, item_2 .... item_8)select "form_field_1, form_field_2 .... form_field_8 union allselect ... union allselect ... KH |
 |
|
|
|
|