Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can cascade delete without constraint?
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01546256
Message ID:
01546262
Views:
41
>>>Hi,
>>>
>>>Typically you can include the ON DELETE CASCADE in the FK Constraint. But I was wondering if it is possible to have a ON DELETE CASCADE without the constraint? TIA.
>>
>>No,
>>Unless you do this in a trigger.
>
>And you effectively have made a constraint except the server won't warn you about it.

You are probably right. But for me it is simple necessary to delete all child rows when the parent table is deleted. But it does not matter if the child table entries match the parent table. The program maintains the the referential integrity on its own; except there is one entry in the child table that will not be in the parent table. This is why I can't go with a constraint.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform