Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: deleteing from two tables with the same record id


Message #1 by jake williamson 28 <jake.williamson@2...> on Wed, 29 May 2002 13:41:47 +0100
hello,

got two tables that are linked buy a customer id. i need to delete the
customer's details from the CUSTOMERS table and the customers info from the
ENTINFO table.

at the moment i've got this in my sql:

"DELETE FROM CUSTOMERS WHERE WINNERID IN (" & strDeleteList & ")"

where strDeleteList is defined on the previous page with check box's.
because the check box's no will be the same in both tables i figure put them
in the same statement!

but how!!!

any feedback would be grand,

cheers,

jake

Message #2 by "Ken Schaefer" <ken@a...> on Thu, 30 May 2002 15:30:18 +1000
DELECT FROM
    ChildTable
WHERE
    ForeignKey IN (" & ... & )

DELETE FROM
    ParentTable
WHERE
    PrimaryKey IN (" & ... & ")

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "jake williamson 28" <jake.williamson@2...>
Subject: [access_asp] deleteing from two tables with the same record id


: got two tables that are linked buy a customer id. i need to delete the
: customer's details from the CUSTOMERS table and the customers info from
the
: ENTINFO table.
:
: at the moment i've got this in my sql:
:
: "DELETE FROM CUSTOMERS WHERE WINNERID IN (" & strDeleteList & ")"
:
: where strDeleteList is defined on the previous page with check box's.
: because the check box's no will be the same in both tables i figure put
them
: in the same statement!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index