Create a Trigger for a view

Results 1 to 2 of 2

Thread: Create a Trigger for a view

  1. #1
    Join Date
    Dec 1969

    Default Create a Trigger for a view

    I have created a view, and now I want to write a trigger <BR><BR>CREATE TRIGGER [InsertView1] ON [dbo].[view1] <BR>FOR INSERT, UPDATE, DELETE <BR>AS<BR> EXEC sp_UpdateAll<BR>GO<BR><BR>I got an error message saying:<BR>Server: Msg 208, Level 16, State 4, Procedure InsertView1, Line 1<BR>Invalid object name &#039;dbo.view1&#039;.<BR><BR>The triggers work well on normal tables.<BR>I can use the view&#039;s information to create cursors in Store Procedures. So that means the view is working out fine.<BR><BR>What&#039;s wrong here?<BR>

  2. #2
    Join Date
    Dec 1969

    Default Need to specify instead of.

    It is only possible to create instead of triggers on views.<BR><BR>Look it up in the docs for create trigger.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts