Asp 『 sql insert multi row data 』

Discussion in 'C#' started by ocm1, Jan 5, 2010.

  1. #1
    Dear sirs,

    Ask you about ASP Master, I has create 2 table,
    my question is : how to insert 5 row data to table02 and 1 row in table01

    form.asp
    bookname
    price

    table01
    refid vbookname vprice
    1 | java | 10


    table02
    trefid tbookname tprice
    1 | Java | 10
    2 | Java | 10
    3 | Java | 10
    4 | Java | 10
    5 | Java | 10


    Picture Provide: http://img403.imageshack.us/img403/4915/tableorder.jpg


    thank you
     
    ocm1, Jan 5, 2010 IP
  2. gangwisch

    gangwisch Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    to insert data into table 1 you would use the following query:
    INSERT INTO table01(vbookname,vprice) VALUES('NewBookName',15.25)

    to insert data into table 2 you would use the following query:
    INSERT INTO table02(tbookname,tprice) VALUES('NewBookName',15.25)

    Please make sure that when you go to the table design mode that refid and trefid is an identity

    Good Luck!
     
    gangwisch, Feb 15, 2010 IP
  3. nadiralishah_webexpert

    nadiralishah_webexpert Guest

    Messages:
    229
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    nadiralishah_webexpert, Feb 16, 2010 IP
  4. chengary

    chengary Banned

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    INSERT INTO table01(vbookname,vprice) VALUES('NewBookName',10)
     
    chengary, Feb 20, 2010 IP