Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 foriegn key realtions! confusion!!

Author  Topic 

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2002-10-12 : 01:55:03
I have the following relation ships
tblcategory is the primary table references table subcategory by a foriegn key,
table subcategory is the primary table references the table tblprodsubcat by a foriegn key ,table tblprodsubcat references table products by a foriegn key.
Now if I have cascade delete on each relation,Is it possible that if i delete a record from the table category ,the related tables from tblsubcategory and tbl products be deleted??
I am a bit confused please help.
thnxs.
Harshal.

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-10-12 : 11:49:24
FROM BOL:
quote:


ON DELETE CASCADE

Specifies that if an attempt is made to delete a row with a key referenced by foreign keys in existing rows in other tables, all rows containing those foreign keys are also deleted. If cascading referential actions have also been defined on the target tables, the specified cascading actions are also taken for the rows deleted from those tables



Here's something that might be of interest to you:
http://www.sqlteam.com/item.asp?ItemID=8866




Edited by - ValterBorges on 10/12/2002 11:53:39
Go to Top of Page
   

- Advertisement -