Deleting record in table B on deleting record in table A using Trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gaurkamal
    New Member
    • Aug 2006
    • 5

    Deleting record in table B on deleting record in table A using Trigger

    I want to delete record in table B when i delete record in Table A both table have a common column. I want to do it using trigger .Can any body give some idea.
    Table details are.

    Table A:
    Channel_ID, Name

    Table B
    User_Id,Channel _ID, Description
  • ramasp
    New Member
    • Sep 2006
    • 19

    #2
    without using trigger
    -------------------------------
    1. You can choose ondelete cascade option in design mode of the table.
    whenever u delete a record from table a the corresponding record from the table b will be deleted

    using trigger
    -------------------
    create a for delete trigger on table a.

    delete from b where channel id..........

    Comment

    Working...