Re: triiger fires stored procedure

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 08/28/04


Date: Sat, 28 Aug 2004 13:00:14 +0100

Yes you can call an SP from a trigger. However, since it is only possible to
pass scalar values to a SP this isn't as useful as it seems. There is no way
for the SP to access the changed rows unless you process the rows one at a
time in a loop in your trigger (definitely not recommended).

-- 
David Portas
SQL Server MVP
--


Relevant Pages

  • Re: Triggers - How can I get a field value?
    ... Within a trigger you have access to two virtual tables called "Deleted" and ... These show the before and after states of the changed rows ... David Portas ... SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • RE: Triggers
    ... changed rows. ... use an INSTEAD OF trigger ... David Portas ... SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Use INSERTED and DELETED in SP
    ... > an "universal History Trigger". ... inserted or deleted data) into one HISTORY table. ... > should be a somehow transaction log, ... >>SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Auto truncate a string to be inserted to SQL table
    ... Tibor Karaszi, SQL Server MVP ... The trigger is merely used to call another ... > stored procedure to validate the record against predefined business rule. ... >> Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Why plural table names? (Celko)
    ... > Calling a table's name a scalar attribute gets us into some strange ... > territory. ... I totally don't think of it as an attribute of the physical system. ... A trigger may be created on a table using the language ...
    (microsoft.public.sqlserver.programming)