How to make Trigger in MySQL?

Asked By 60 points N/A Posted on -
qa-featured

Hi Everyone,

I am using MySQL 3.51 for a online store.

There are many repeated customers in the site.

So, I want to maintain a database of the repeated customers.

How can I implement a Trigger for those customer account for two fields?

Please help with an example.

Can anyone give me some videos?

Thanks.

 

SHARE
Answered By 0 points N/A #141495

How to make Trigger in MySQL?

qa-featured

Triggers are very useful for your program here is the simplest format how you can create triggers in sql

//INSERT Trigger

CREATE TRIGGER tr_insert_employee

ON Employees

for insert

as

if (select province from inserted) <> 'BC'

BEGIN

PRINT 'record will not update if province is not BC'

ROLLBACK TRANSACTION

END 

Login/Register to Answer

Related Questions