Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    15

    Unanswered: trigger doesnt work on view?

    hallo
    have maybe easy problem, but cannot get over it. I have view, and i have create a test trigger on it :

    CREATE TRIGGER [PERSONAL_PERSONAL_UPDATE] ON [dbo].[PERSONAL_PERSONAL]
    INSTEAD OF UPDATE
    AS
    insert into test values ('s')


    its just for testing

    but when update anything in PERSONAL_PERSONAL , change is normally saved and no 's' is inserted into test... it seems to me that trigger is not fired?

    I have tryed to change data in Enterprise manager and aswell through my aplication

    any hits what am i doing wrong?

    thanks

    Polp

  2. #2
    Join Date
    Jan 2003
    Location
    Dordrecht, The Netherlands
    Posts
    95

    Re: trigger doesnt work on view?

    Add the WITH VIEW_METADATA clause in your view definition. I was surprised to see myself that you need it to force an INSTEAD OF trigger to fire.

    Example:

    CREATE VIEW PERSONAL_PERSONAL
    WITH VIEW_METADATA
    AS
    ....

Posting Permissions

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