Hi everyone,
I spent a lot of time on this, but still have no idea how to get it working
This are the tables with forign keys that I have:
Table1 has table_1_id, table_1_data columns
Table2 has table_1_id, table_2_id, table_2_data columns
Table3 has table_2_id, table_3_id, table_3_data columns
Table4 has table_3_id, table_4_id, table_4_data columns
If I delete a row in table1, any related rows in table2 should be deleted, and at the same time, any rows in table3 which are related to table2 and related to table1 should be deleted as well and so on...
is there a way that I can write a SQL query to do it?
I am using MS SQL 2000 and ASP.net C#
Many thanks
EricLookup "cascading referential integrity constraints" in BOL, you can use the on delete cascade function for your foreign keys
HTH|||Originally posted by rhigdon
Lookup "cascading referential integrity constraints" in BOL, you can use the on delete cascade function for your foreign keys
HTH
Thanks for the information, this gives me a good hint. But I don't know what "BOL" means, could you explain it to me?
Thanks a lot
Eric|||Sorry, BOL is Books-online. It comes installed with SQL and is the best resource a SQL developer has (in the grand scheme of things) If you do not have it installed, you should and if you have not downloaded the latest BOL from MS (SP3A) you should and can at this location.
http://www.microsoft.com/downloads/details.aspx?FamilyID=683D71A6-BCF4-45A6-A2E2-F6AB5BE3EF12&displaylang=en
GL
No comments:
Post a Comment