Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql delete from 5 linked tables

Status
Not open for further replies.

martinrobson

Programmer
Jun 2, 2003
19
0
0
GB
hi,

could someone point me in the right direction.

I have an sql statement which i would like to use to delete a selection from a dropdown vb list.

The SQL i am using is

DELETE FROM tablename A, tablename B, tablename C, tablename D, tablename E where A.ID = B.ID and B_ID = C_ID and C_ID = D_ID and C_ID2 = E_ID and " (the rest is vb)

i get a syntax error, for a missing operator.

Can anyone help,

basically i am trying to delete some data from 5 tables which is all linked to each other with a series of id keys.

thanks
 
You may delete only from 1 table in a shot. Though creating FK with ON DELETE CASCADE may need deleting from the parent table only.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top