Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need a SQL expert help : How to create a trigger for DELETE ???????
In article <35D06821.56CD542E_at_sftw.umac.mo>,
d951686_at_sftw.umac.mo wrote:
> Hello,
>
> How can I create a TRIGGER for DELETE a record ?
>
> Such as, when I delete a record, it will auto copy this record to
> another TABLE ???
>
> Best regards,
> Eric
In Sybase SQL Server:
assuming your base table is MYTABLE and you want to copy deleted records to MYTABLE_ARCHIVE create trigger MYTABLE_DEL_TRIG on MYTABLE for delete as insert MYTABLE_ARCHIVE select * from deleted go
-- Bret Halford Sybase, Inc. 3665 Discovery Drive Boulder, CO 80303 -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member ForumReceived on Tue Aug 11 1998 - 00:00:00 CDT
![]() |
![]() |