Table can have trigger on insert/delete/update. Trigger will be fired internally by DB engine.
Is it possible to pass a parameter to trigger in SQL server database like StoreProcedure?
Table can have trigger on insert/delete/update. Trigger will be fired internally by DB engine.
Is it possible to pass a parameter to trigger in SQL server database like StoreProcedure?
Indirectly via CONTEXT_INFO()
. See Using Session Context Information. The fact that your trigger needs extra state is always a code smell.
You can kludge it. Create a table specifically designed to hold the parameter information, then place data into the the parameter table before performing the operation that will initiate the trigger. Code the trigger to read from the parameter table.
That was the carrot, here is the stick: