Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can you give me an example of an On Delete cascade in sqlserver?
Posted
Updated 2-Jun-11 21:21pm
v2

1 solution

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.

Ref:http://msdn.microsoft.com/en-us/library/aa933119(v=sql.80).aspx[^]

Example:http://rudesyle.wordpress.com/2008/01/28/cascading-deletes-in-sql-server/[^]
 
Share this answer
 
v2
Comments
Dalek Dave 3-Jun-11 3:21am    
Good Answer.
N Jhansi 3-Jun-11 4:54am    
Good Answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900