How to insert record into two table at a time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rohullah
    New Member
    • Mar 2010
    • 43

    How to insert record into two table at a time

    I want to insert record into two table at a time.
    For example i have two table student1 and student2 with the same structure
    now i want to insert record into student1 the record of student1 should automiticlly insert into studendt2 table.
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    Originally posted by Rohullah
    Hello

    I want to insert record into two table at a time.
    for example i have two table student1 and student2 with the same structure
    now i want to insert record into student1 the record of student1 should automiticlly insert into studendt2 table

    looking forword.
    thank you.
    edit reply report
    either you can use two insert queries or you can use triggers which will automatically insert record to the other table on insert...
    refere to this tutorial

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Better use a procedure for the purpose.

      Comment

      • ThatThatGuy
        Recognized Expert Contributor
        • Jul 2009
        • 453

        #4
        Originally posted by Rohullah
        Hello

        I want to insert record into two table at a time.
        for example i have two table student1 and student2 with the same structure
        now i want to insert record into student1 the record of student1 should automiticlly insert into studendt2 table

        looking forword.
        thank you.
        Ya that could also be done

        Comment

        Working...