Showing posts with label cascade. Show all posts
Showing posts with label cascade. Show all posts

Monday, March 12, 2012

Question on OUTPUT feature of DML

I need to audit inserts/updates/deletes on active tables to audit tables on a set of tables that have foreign key constaints with the update cascade and delete cascade defined. I can explicitly code the delete/update on the parent table to perform an OUTPUT to an audit table, but how do I OUTPUT the cascaded delete/update that happens on the child table because of the FK constraint with delete cascade defined without having to resort to triggers.

Thanks,

-chiraj

You might want to check into the use of DML triggers for this kind of issue, but this is not something that I have used much.


Dave

|||

Thanks for the response.

Using DML triggers is a no-brainer. I have used them all my life. I was wondering if it could be accomplished with the OUTPUT clause. I believe it is a limitation of the OUTPUT clause unless someone can show me otherwise.

Thanks,

-chiraj.

Question on ON DELETE CASCADE

I have a master table and a child table. I have created a foreignkey
constraint on the child table with OUT the ON DELETE CASCADE option.
Now when I delete records from the Master table, can I specify "on
delete cascade" at that time.
Or I can do that only if I specify when the foreign key is created.
Thanks in advance.Hi
> Or I can do that only if I specify when the foreign key is created.
Yes
"SQL novice" <balacr@.gmail.com> wrote in message
news:1132299915.134325.257320@.g44g2000cwa.googlegroups.com...
>I have a master table and a child table. I have created a foreignkey
> constraint on the child table with OUT the ON DELETE CASCADE option.
> Now when I delete records from the Master table, can I specify "on
> delete cascade" at that time.
> Or I can do that only if I specify when the foreign key is created.
> Thanks in advance.
>