Results 1 to 3 of 3

Thread: deleting a single record from multiple tables

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    88

    deleting a single record from multiple tables

    Hi All
    i have a common field say email in 5 tables.
    i want to delete a single record which should be deleted from all the table from which the email is related.
    can anybody suggest me for the same.
    Thanks

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: deleting a single record from multiple tables

    You should run 5 separate Delete statements, all within a transaction (so either they will all be deleted, or none of them will be).

    Exactly how you do this depends on a few factors, such as what database system you are using, and where you want to run this from.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    88

    Re: deleting a single record from multiple tables

    I m using sql server2000 as an backend. and ASP front end.
    I want to make a function and want to call it in asp page.
    in this function i need to write delete command .





    Quote Originally Posted by si_the_geek
    You should run 5 separate Delete statements, all within a transaction (so either they will all be deleted, or none of them will be).

    Exactly how you do this depends on a few factors, such as what database system you are using, and where you want to run this from.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width