delete rows from two tables using one sql statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vikysaran
    New Member
    • Nov 2006
    • 14

    delete rows from two tables using one sql statement

    Hi,
    i want to delete rows from two tables using one sql statement.

    One table is tblEmployee and other is tblUser and i want to delete all record in both of table whose UserID is EE00001
  • sakumar9
    Recognized Expert New Member
    • Jan 2008
    • 127

    #2
    1. This is not possible by a single DELETE statement;
    2. You can write a stored procedure or function to do so;
    3. You can implement some primary-key, foreign key relationship(if possible), and delete from parent table (use ON DELETE CASCADE option), this will delete rows from both tables;


    Regards
    -- Sanjay

    Comment

    Working...