How to Insert records in Two Related tables using Stored Procedures

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AsifRaja
    New Member
    • May 2010
    • 1

    How to Insert records in Two Related tables using Stored Procedures

    I have two tables here is the description:
    Employees (E_ID(Primary key), Name, Address)
    EmployeeEmails( E_ID(Foreign Key), EmailID(Primary Key), email)

    I want to write a stored procedure which will insert record in Employees as well as Multiple Emails related to that perticular employee in EmployeeEmails Table....

    I'll appreciate little help.
  • Jim Doherty
    Recognized Expert Contributor
    • Aug 2007
    • 897

    #2
    Originally posted by AsifRaja
    I have two tables here is the description:
    Employees (E_ID(Primary key), Name, Address)
    EmployeeEmails( E_ID(Foreign Key), EmailID(Primary Key), email)

    I want to write a stored procedure which will insert record in Employees as well as Multiple Emails related to that perticular employee in EmployeeEmails Table....

    I'll appreciate little help.
    There are lots of reference to INSERTS that exist on the web. May I suggest that you attempt to show your understanding of:-

    A) Where the data is coming from and in what format in order to insert it
    B) Demonstrate some coding attempt yourself as to your understanding of that process.

    I am sure contributor help will be forthcoming and appreciate this input from you.

    Here is an MSDN link reference for you to look at insert syntax

    Comment

    Working...