Click here to Skip to main content
15,920,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
If I want to apply the ON DELETE CASCADE AND ON DELETE UPDATE , Together while creating a child table, I realized that i should write Delete cascade earlier to Updade cascade. Why ? Please Help.
Posted

1 solution

shikhar wrote:
ON DELETE CASCADE AND ON DELETE UPDATE

Are you sure shikhar that ON DELETE UPDATE is a true sentance ?

I can see clearly from the SQL Foreign key constrain syntax that.

ON DELETE ( CASCADE | NO ACTION )
ON UPDATE ( CASCADE | NO ACTION )

So how you will apply ON DELETE UPDATE ? Which isn't accordingly true wrt syntax ?
 
Share this answer
 
Comments
Manfred Rudolf Bihy 3-Jan-11 8:46am    
Maybe OP meant to implement an INSTEAD OF trigger for DELETE?
I'm just guessing as OP is not so clear in his requirements. :)
Hiren solanki 3-Jan-11 8:48am    
No Manfred he's just want to apply cascade constrain while defining foreign key. but he's asking some what question that made me in confusion couple of times.

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