I have never written a trigger before, but I have a couple of uses for
them now so I am trying. I have a view that I created and I want to
have this trigger, run anytime the view is run. I don't know if my
problem is with the trigger or permissions on the view, right now I
have given everyone permission to select and update on the view (just
trying to figure this out). Here is the begining of my trigger.
use OTB
If Exists (Select name from sysobjects
Where name='trg_otb_update_catalog_udf' and type='TR')
Drop Trigger trg_otb_update_catalog_udf
Go
Create Trigger trg_otb_update_catalog_udf
On vw_OTB_catalog
For Insert, update
as
Update ar_cust_udf
set part_catalog=c1.parts_catalog
etc...
Everything in the update statement to the end of the trigger works as
I intended. However when I run this it will not create the trigger,
instead it errors and returns the following:
Server: Msg 208, Level 16, State 4, Procedure
trg_otb_update_catalog_udf, Line 1
Invalid object name 'vw_OTB_catalog'.
However this is the correct view name.
any ideas?
Thanks,
Mike