multiple insert

Results 1 to 3 of 3

Thread: multiple insert

  1. #1
    Join Date
    Dec 1969

    Default multiple insert

    I need to create a fairly complicated multiple insert.<BR><BR>I have a db table with the following fields:<BR>sku &#124 fyear &#124 fmonth &#124 units<BR><BR>Then I need to enter information from a HTML form that has Jan - Dec across the top. this year and next year down the left. This is has a repeat region by SKU, and there are about 20 sku. So a lot of data to enter. 40 x 12 input fields.<BR>Once all filled out, I need it to enter the info into the above table.<BR><BR>how would I do a multiple insert like this ?<BR><BR>Is this even the right way to do it or should I just have 24 fields in the database, instead of fmonth and fyear. <BR><BR>thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: multiple insert

    No, don&#039;t add columns. Keep the table realatively normalized. You&#039;ll likely thank yourself in the long run.<BR><BR>It sounds like you just need to loop through the values and insert them one after the other.

  3. #3
    Join Date
    Dec 1969

    Default Agree w/ riprod...

    Either do looping, by hand, bypassing the DataTable stuff.<BR><BR>Or create a StoredProc that takes all 12 months as parameters and then does the 12 inserts. <BR><BR>But probably simple to just do the looping.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts