Run Store Proc when table is updated with record

  • Hello,

    I wanted to know if it is possible to run a stored proc (report) when a new record is inserted / updated into a certain table. Also if it could do so for records with a column that meet a certain criteria ie. sell description like '%test%'

  • Yes, with a trigger, however running long processes from a trigger is a really bad idea. Probably better to put the report code in a SQL job and in the trigger start the job if the conditions are met. That way the insert/update finishes immediately and the job can run async.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hey I appreciate the quick response. I havne't done much work with triggers and am looking up resources on how to get a trigger to catch a certain condition on a column as you said. Can you weigh in on that? Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply