February 25, 2009 at 3:51 am
Hi Friends,
I try to implement trigger for Before Insert.
But i got an error. My trigger event is below.
CREATE TRIGGER Trig_Insert_author
BEFORE INSERT ON tblauthors
AS DECLARE @au_id INT
BEGIN
SELECT @au_id=(SELECT au_id from inserted)
SELECT *from authors
ENd
BEGIN
DELETE FROM authors WHERE au_id=@au_id
END
My exception is :Incorrect syntax near 'BEFORE'. Please intimate me that what mistakes i have in my query.
Hope yours reply.
Regards
Ashok
February 25, 2009 at 3:57 am
sql server only uses after and instead of triggers.
February 25, 2009 at 4:02 am
Hi friend,
Thanks for your reply.
In which query language have a BEFORE TRIGGER
Regards
Ashok
February 25, 2009 at 4:19 am
oracle *spit* does. not sure about the others.
February 25, 2009 at 4:21 am
Its only in oracle
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply