Link to home
Start Free TrialLog in
Avatar of rpkhare
rpkhareFlag for India

asked on

Passing parameter to a Trigger

Can I pass parameters to a Trigger?
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rpkhare

ASKER

Actually I want to update an old record in a table in which a new record is inserted. From your answer it seems that I'll have to write a Stored Procedure.
I'm agree with Angelll on can't pass parameter directlyto triggers bcoz you do not call a trigger.

But how about calling a stored procedure inside a trigger and availing the required parameter???

Inside trigger you call a sp like this..

call uNeedParameter(OUT param1);

or

call uNeedParameter(@param1);

Later you can use ' param1' in the body of trigger?

Does it make sense?

Avatar of rpkhare

ASKER

Will it be an overhead or not? What is the advantage of calling a Stored Procedure from a trigger?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rpkhare

ASKER

Thanks